Class: Racc::StateTransitionTable
- Defined in:
 - lib/racc/statetransitiontable.rb,
lib/racc/statetransitiontable.rb 
Overview
reopen
Instance Attribute Summary collapse
- 
  
    
      #action_check  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute action_check.
 - 
  
    
      #action_default  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute action_default.
 - 
  
    
      #action_pointer  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute action_pointer.
 - 
  
    
      #action_table  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute action_table.
 - 
  
    
      #debug_parser  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute debug_parser.
 - 
  
    
      #goto_check  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute goto_check.
 - 
  
    
      #goto_default  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute goto_default.
 - 
  
    
      #goto_pointer  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute goto_pointer.
 - 
  
    
      #goto_table  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute goto_table.
 - 
  
    
      #grammar  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute grammar.
 - 
  
    
      #nt_base  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute nt_base.
 - 
  
    
      #reduce_n  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute reduce_n.
 - 
  
    
      #reduce_table  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute reduce_table.
 - 
  
    
      #shift_n  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute shift_n.
 - 
  
    
      #states  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute states.
 - 
  
    
      #token_table  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute token_table.
 - 
  
    
      #token_to_s_table  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute token_to_s_table.
 - 
  
    
      #use_result_var  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute use_result_var.
 
Class Method Summary collapse
Instance Method Summary collapse
- 
  
    
      #initialize(states)  ⇒ StateTransitionTable 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of StateTransitionTable.
 - #parser_class ⇒ Object
 - #token_value_table ⇒ Object
 
Constructor Details
#initialize(states) ⇒ StateTransitionTable
Returns a new instance of StateTransitionTable.
      44 45 46 47 48 49 50  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 44 def initialize(states) super() @states = states @grammar = states.grammar self.use_result_var = true self.debug_parser = true end  | 
  
Instance Attribute Details
#action_check ⇒ Object
Returns the value of attribute action_check
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def action_check @action_check end  | 
  
#action_default ⇒ Object
Returns the value of attribute action_default
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def action_default @action_default end  | 
  
#action_pointer ⇒ Object
Returns the value of attribute action_pointer
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def action_pointer @action_pointer end  | 
  
#action_table ⇒ Object
Returns the value of attribute action_table
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def action_table @action_table end  | 
  
#debug_parser ⇒ Object
Returns the value of attribute debug_parser
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def debug_parser @debug_parser end  | 
  
#goto_check ⇒ Object
Returns the value of attribute goto_check
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def goto_check @goto_check end  | 
  
#goto_default ⇒ Object
Returns the value of attribute goto_default
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def goto_default @goto_default end  | 
  
#goto_pointer ⇒ Object
Returns the value of attribute goto_pointer
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def goto_pointer @goto_pointer end  | 
  
#goto_table ⇒ Object
Returns the value of attribute goto_table
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def goto_table @goto_table end  | 
  
#grammar ⇒ Object (readonly)
Returns the value of attribute grammar.
      53 54 55  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 53 def grammar @grammar end  | 
  
#nt_base ⇒ Object
Returns the value of attribute nt_base
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def nt_base @nt_base end  | 
  
#reduce_n ⇒ Object
Returns the value of attribute reduce_n
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def reduce_n @reduce_n end  | 
  
#reduce_table ⇒ Object
Returns the value of attribute reduce_table
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def reduce_table @reduce_table end  | 
  
#shift_n ⇒ Object
Returns the value of attribute shift_n
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def shift_n @shift_n end  | 
  
#states ⇒ Object (readonly)
Returns the value of attribute states.
      52 53 54  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 52 def states @states end  | 
  
#token_table ⇒ Object
Returns the value of attribute token_table
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def token_table @token_table end  | 
  
#token_to_s_table ⇒ Object
Returns the value of attribute token_to_s_table
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def token_to_s_table @token_to_s_table end  | 
  
#use_result_var ⇒ Object
Returns the value of attribute use_result_var
      23 24 25  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 23 def use_result_var @use_result_var end  | 
  
Class Method Details
.generate(states) ⇒ Object
      40 41 42  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 40 def StateTransitionTable.generate(states) StateTransitionTableGenerator.new(states).generate end  | 
  
Instance Method Details
#parser_class ⇒ Object
      55 56 57  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 55 def parser_class ParserClassGenerator.new(@states).generate end  | 
  
#token_value_table ⇒ Object
      59 60 61 62 63 64 65  | 
    
      # File 'lib/racc/statetransitiontable.rb', line 59 def token_value_table h = {} token_table().each do |sym, i| h[sym.value] = i end h end  |