Class: KoiReferenceCompiler::SyntaxNode
- Inherits:
-
Object
- Object
- KoiReferenceCompiler::SyntaxNode
- Defined in:
- lib/koi-reference-compiler/syntax_node.rb
Direct Known Subclasses
AdditionOperator, AdditiveExpression, Assignment, AssignmentOperator, Block, ComparativeExpression, DivisionOperator, EqualityOperator, Expression, FalseLiteral, FloatLiteral, FunctionCall, FunctionDefinition, GreaterThanOperator, HashAccess, HashAccessor, HashAccessorList, HashAssignment, HashLiteral, Identifier, If, InequalityOperator, IntegerLiteral, KeyValue, KeyValueList, LessThanOperator, MultiplicationOperator, MultitiveExpression, NilLiteral, Statement, StringLiteral, SubtractionOperator, TrueLiteral, Unless
Instance Attribute Summary collapse
-
#elements ⇒ Object
Returns the value of attribute elements.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#text_value ⇒ Object
Returns the value of attribute text_value.
Instance Method Summary collapse
-
#initialize(text_value, offset, elements = nil) ⇒ SyntaxNode
constructor
A new instance of SyntaxNode.
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
#elements ⇒ Object
Returns the value of attribute elements.
5 6 7 |
# File 'lib/koi-reference-compiler/syntax_node.rb', line 5 def elements @elements end |
#offset ⇒ Object
Returns the value of attribute offset.
5 6 7 |
# File 'lib/koi-reference-compiler/syntax_node.rb', line 5 def offset @offset end |
#parent ⇒ Object
Returns the value of attribute parent.
5 6 7 |
# File 'lib/koi-reference-compiler/syntax_node.rb', line 5 def parent @parent end |
#text_value ⇒ Object
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 |