Class: Musa::GenerativeGrammar::Implementation::FinalNode Private
- Defined in:
- lib/musa-dsl/generative/generative-grammar.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Terminal node with fixed content.
Represents a leaf node in the grammar tree with constant content.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
readonly
private
node attributes.
-
#content ⇒ Object
readonly
private
node content.
Instance Method Summary collapse
- #_options(parent: nil, &condition) ⇒ Object private
- #initialize(content, attributes) ⇒ void constructor private
Constructor Details
#initialize(content, attributes) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
468 469 470 471 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 468 def initialize(content, attributes) super() @element = OptionElement.new(content, attributes) end |
Instance Attribute Details
#attributes ⇒ Hash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
node attributes
458 459 460 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 458 def attributes @attributes end |
#content ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
node content
458 459 460 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 458 def content @content end |
Instance Method Details
#_options(parent: nil, &condition) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 474 def (parent: nil, &condition) parent ||= [] if block_given? if yield(parent + [@element]) [[@element]] else [] end else [[@element]] end end |