Class: Musa::GenerativeGrammar::Implementation::NextNode 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.
Node representing sequence of two nodes.
Generates options with node followed by after.
Created by Musa::GenerativeGrammar::Implementation::Node#next or + operator.
Instance Method Summary collapse
- #_options(parent: nil, &condition) ⇒ Object private
- #initialize(node, after) ⇒ void constructor private
Constructor Details
#initialize(node, after) ⇒ 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.
610 611 612 613 614 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 610 def initialize(node, after) @node = node @after = after super() 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.
617 618 619 620 621 622 623 624 625 626 627 |
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 617 def (parent: nil, &condition) parent ||= [] r = [] @node.(parent: parent, &condition).each do |node_option| @after.(parent: parent + node_option, &condition).each do |after_option| r << node_option + after_option unless after_option.empty? end end r end |