123456789_123456789_123456789_123456789_123456789_

Class: Racc::StateTransitionTable

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: Struct
  • ::Object
Defined in: lib/racc/statetransitiontable.rb,
lib/racc/statetransitiontable.rb

Overview

reopen

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(states) ⇒ StateTransitionTable

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 43

def initialize(states)
  super()
  @states = states
  @grammar = states.grammar
  self.use_result_var = true
  self.debug_parser = true
end

Class Method Details

.generate(states)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 39

def StateTransitionTable.generate(states)
  StateTransitionTableGenerator.new(states).generate
end

Instance Attribute Details

#action_check (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#action_default (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#action_pointer (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#action_table (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#debug_parser (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#goto_check (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#goto_default (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#goto_pointer (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#goto_table (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#grammar (readonly)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 52

attr_reader :grammar

#nt_base (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#reduce_n (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#reduce_table (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#shift_n (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#states (readonly)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 51

attr_reader :states

#token_table (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#token_to_s_table (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

#use_result_var (rw)

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 22

StateTransitionTable = Struct.new(:action_table,
:action_check,
:action_default,
:action_pointer,
:goto_table,
:goto_check,
:goto_default,
:goto_pointer,
:token_table,
:reduce_table,
:reduce_n,
:shift_n,
:nt_base,
:token_to_s_table,
:use_result_var,
:debug_parser)

Instance Method Details

#parser_class

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 54

def parser_class
  ParserClassGenerator.new(@states).generate
end

#token_value_table

[ GitHub ]

  
# File 'lib/racc/statetransitiontable.rb', line 58

def token_value_table
  h = {}
  token_table().each do |sym, i|
    h[sym.value] = i
  end
  h
end