In Files

  • racc/statetransitiontable.rb

Parent

Methods

Racc::ParserClassGenerator

Public Class Methods

new(states) click to toggle source
 
               # File racc/statetransitiontable.rb, line 263
def initialize(states)
  @states = states
  @grammar = states.grammar
end
            

Public Instance Methods

generate() click to toggle source
 
               # File racc/statetransitiontable.rb, line 268
def generate
  table = @states.state_transition_table
  c = Class.new(::Racc::Parser)
  c.const_set :Racc_arg, [table.action_table,
                          table.action_check,
                          table.action_default,
                          table.action_pointer,
                          table.goto_table,
                          table.goto_check,
                          table.goto_default,
                          table.goto_pointer,
                          table.nt_base,
                          table.reduce_table,
                          table.token_value_table,
                          table.shift_n,
                          table.reduce_n,
                          false]
  c.const_set :Racc_token_to_s_table, table.token_to_s_table
  c.const_set :Racc_debug_parser, true
  define_actions c
  c
end
            
There is an updated format of the API docs for this version here.