Class: Furnace::Code::NonterminalToken
- Defined in:
- lib/furnace/code/nonterminal_token.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(origin, children, options = {}) ⇒ NonterminalToken
constructor
A new instance of NonterminalToken.
- #to_text ⇒ Object
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, ={}) super(origin, ) @children = children.compact end |
Instance Attribute Details
#children ⇒ Object (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_text ⇒ Object
11 12 13 |
# File 'lib/furnace/code/nonterminal_token.rb', line 11 def to_text children.map(&:to_text).join end |