Class: Foxtail::Syntax::Parser::AST::TermReference

Inherits:
SyntaxNode show all
Defined in:
lib/foxtail/syntax/parser/ast/term_reference.rb

Overview

Represents references to terms with optional attribute access and arguments

Instance Attribute Summary collapse

Attributes inherited from SyntaxNode

#span

Attributes inherited from BaseNode

#type

Instance Method Summary collapse

Methods inherited from SyntaxNode

#add_span

Methods inherited from BaseNode

#==, #accept, #to_h

Constructor Details

#initialize(id, attribute = nil, arguments = nil) ⇒ TermReference

Returns a new instance of TermReference.



13
14
15
16
17
18
# File 'lib/foxtail/syntax/parser/ast/term_reference.rb', line 13

def initialize(id, attribute=nil, arguments=nil)
  super()
  @id = id
  @attribute = attribute
  @arguments = arguments
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



11
12
13
# File 'lib/foxtail/syntax/parser/ast/term_reference.rb', line 11

def arguments
  @arguments
end

#attributeObject

Returns the value of attribute attribute.



10
11
12
# File 'lib/foxtail/syntax/parser/ast/term_reference.rb', line 10

def attribute
  @attribute
end

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/foxtail/syntax/parser/ast/term_reference.rb', line 9

def id
  @id
end

Instance Method Details

#childrenObject



20
# File 'lib/foxtail/syntax/parser/ast/term_reference.rb', line 20

def children = [id, attribute, arguments].compact