# File lib/racc/statetransitiontable.rb, line 273
273: def generate
274: table = @states.state_transition_table
275: c = Class.new(::Racc::Parser)
276: c.const_set :Racc_arg, [table.action_table,
277: table.action_check,
278: table.action_default,
279: table.action_pointer,
280: table.goto_table,
281: table.goto_check,
282: table.goto_default,
283: table.goto_pointer,
284: table.nt_base,
285: table.reduce_table,
286: table.token_value_table,
287: table.shift_n,
288: table.reduce_n,
289: false]
290: c.const_set :Racc_token_to_s_table, table.token_to_s_table
291: c.const_set :Racc_debug_parser, true
292: define_actions c
293: c
294: end
# File lib/racc/statetransitiontable.rb, line 298
298: def define_actions(c)
299: c.module_eval "def _reduce_none(vals, vstack) vals[0] end"
300: @grammar.each do |rule|
301: if rule.action.empty?
302: c.funcall(:alias_method, "_reduce_#{rule.ident}", :_reduce_none)
303: else
304: c.funcall(:define_method, "_racc_action_#{rule.ident}", &rule.action.proc)
305: c.module_eval(s = def _reduce_#{rule.ident}(vals, vstack) _racc_action_#{rule.ident}(*vals) end, __FILE__, __LINE__ + 1)
306: end
307: end
308: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.