Class: KoiReferenceCompiler::SyntaxNode

Inherits:
Object
  • Object
show all
Defined in:
lib/koi-reference-compiler/syntax_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text_value, offset, elements = nil) ⇒ SyntaxNode

Returns a new instance of SyntaxNode.



7
8
9
10
11
12
13
14
15
# File 'lib/koi-reference-compiler/syntax_node.rb', line 7

def initialize(text_value, offset, elements = nil)
  @parent = nil
  @elements = elements
  @offset = offset
  @text_value = text_value
  elements.each do |element|
    element.parent = self
  end unless(elements.nil?)
end

Instance Attribute Details

#elementsObject

Returns the value of attribute elements.



5
6
7
# File 'lib/koi-reference-compiler/syntax_node.rb', line 5

def elements
  @elements
end

#offsetObject

Returns the value of attribute offset.



5
6
7
# File 'lib/koi-reference-compiler/syntax_node.rb', line 5

def offset
  @offset
end

#parentObject

Returns the value of attribute parent.



5
6
7
# File 'lib/koi-reference-compiler/syntax_node.rb', line 5

def parent
  @parent
end

#text_valueObject

Returns the value of attribute text_value.



5
6
7
# File 'lib/koi-reference-compiler/syntax_node.rb', line 5

def text_value
  @text_value
end