Class: Kumi::Core::NAST::Node

Inherits:
Struct
  • Object
show all
Defined in:
lib/kumi/core/nast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Node



18
19
20
21
22
# File 'lib/kumi/core/nast.rb', line 18

def initialize(**args)
  super
  self.id ||= NAST.next_id
  self.meta ||= {}
end

Instance Attribute Details

#idObject

Returns the value of attribute id



17
18
19
# File 'lib/kumi/core/nast.rb', line 17

def id
  @id
end

#locObject

Returns the value of attribute loc



17
18
19
# File 'lib/kumi/core/nast.rb', line 17

def loc
  @loc
end

#metaObject

Returns the value of attribute meta



17
18
19
# File 'lib/kumi/core/nast.rb', line 17

def meta
  @meta
end

Instance Method Details

#accept(visitor) ⇒ Object



24
25
26
# File 'lib/kumi/core/nast.rb', line 24

def accept(visitor)
  visitor.visit_node(self)
end