Class: Aurum::Builder::Sources

Inherits:
Hash
  • Object
show all
Defined in:
lib/aurum/grammar/builder/parsing_table_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state, symbol, sources = nil, lookahead = nil) ⇒ Sources

Returns a new instance of Sources.



177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/aurum/grammar/builder/parsing_table_builder.rb', line 177

def initialize(state, symbol, sources = nil, lookahead = nil)
  @sources, @stack_seen = {}, []
  for action in state.actions[symbol]
    @sources[action] = [].to_set
    if sources
      @sources[action] = initialize_lookahead_state(sources[action], symbol, lookahead)
    else
      @sources[action] = initialize_state(state, action, symbol)
    end
  end
  super(@sources)
end

Instance Attribute Details

#stack_seenObject (readonly)

Returns the value of attribute stack_seen.



176
177
178
# File 'lib/aurum/grammar/builder/parsing_table_builder.rb', line 176

def stack_seen
  @stack_seen
end