Slide 39
Slide 39 text
IELR Implementation in Lrama
def split_states
(...snip...)
transition_queue = []
@states.first.transitions.each do |shift, next_state|
transition_queue << [@states.first, shift, next_state]
end
until transition_queue.empty?
state, shift, next_state = transition_queue.shift
compute_state(state, shift, next_state)
next_state.transitions.each do |sh, next_st|
transition_queue << [next_state, sh, next_st]
end
end
end