Class: Furnace::Code::NonterminalToken

Inherits:
Token
  • Object
show all
Defined in:
lib/furnace/code/nonterminal_token.rb

Direct Known Subclasses

SurroundedToken

Instance Attribute Summary collapse

Attributes inherited from Token

#origin

Instance Method Summary collapse

Methods inherited from Token

#subscribe, #to_structure, #type, type, #unsubscribe

Constructor Details

#initialize(origin, children, options = {}) ⇒ NonterminalToken

Returns a new instance of NonterminalToken.



6
7
8
9
# File 'lib/furnace/code/nonterminal_token.rb', line 6

def initialize(origin, children, options={})
  super(origin, options)
  @children = children.compact
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



4
5
6
# File 'lib/furnace/code/nonterminal_token.rb', line 4

def children
  @children
end

Instance Method Details

#to_textObject



11
12
13
# File 'lib/furnace/code/nonterminal_token.rb', line 11

def to_text
  children.map(&:to_text).join
end