Class: Musa::GenerativeGrammar::Implementation::FinalNode
- Defined in:
- lib/musa-dsl/generative/generative-grammar.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
- #_options(parent: nil, &condition) ⇒ Object
-
#initialize(content, attributes) ⇒ FinalNode
constructor
A new instance of FinalNode.
Methods inherited from Node
#[], #limit, #next, #options, #or, #repeat, #size, #to_serie
Constructor Details
#initialize(content, attributes) ⇒ FinalNode
Returns a new instance of FinalNode.
147 148 149 150 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 147 def initialize(content, attributes) super() @element = OptionElement.new(content, attributes) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
145 146 147 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 145 def attributes @attributes end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
144 145 146 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 144 def content @content end |
Instance Method Details
#_options(parent: nil, &condition) ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 152 def (parent: nil, &condition) parent ||= [] if block_given? if yield(parent + [@element]) [[@element]] else [] end else [[@element]] end end |