Class: Aurum::Parser::SemanticActionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/aurum/engine.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ SemanticActionContext

Returns a new instance of SemanticActionContext.



150
151
152
# File 'lib/aurum/engine.rb', line 150

def initialize hash
	@hash = hash
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



154
155
156
157
158
159
# File 'lib/aurum/engine.rb', line 154

def method_missing name, *args
	name_string = name.to_s
	index = name_string =~ /\d+/ ? name_string.slice!(/\d+/).to_i : 0
	@hash[name_string][-index] and return @hash[name_string][-index]
	SemanticAttributes.new
end