class Racc::ParserClassGenerator

def define_actions(c)

def define_actions(c)
  c.module_eval "def _reduce_none(vals, vstack) vals[0] end"
  @grammar.each do |rule|
    if rule.action.empty?
      c.alias_method("_reduce_#{rule.ident}", :_reduce_none)
    else
      c.define_method("_racc_action_#{rule.ident}", &rule.action.proc)
      c.module_eval(<<-End, __FILE__, __LINE__ + 1)
        def _reduce_#{rule.ident}(vals, vstack)
          _racc_action_#{rule.ident}(*vals)
        end
      End
    end
  end
end