10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/ibex/table_simulation/text.rb', line 10
def render_step(step)
detail = case step.action
when "shift" then " target=#{step.target_state}"
when "reduce"
" production=#{step.production_id} lhs=#{step.lhs} rhs=#{step.rhs_length} " \
"goto=#{step.target_state}"
else ""
end
"#{step.sequence}: state=#{step.state} token=#{step.token.inspect} action=#{step.action}" \
"#{detail} source=#{step.action_source} stack=#{step.stack_depth_before}->#{step.stack_depth_after}"
end
|