Class: Rattler::Compiler::ParserGenerator::AttributedSequenceGenerator

Inherits:
ExprGenerator
  • Object
show all
Includes:
SequenceGenerating
Defined in:
lib/rattler/compiler/parser_generator/attributed_sequence_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SequenceGenerating

#gen_assert, #gen_disallow, #gen_skip, #gen_token

Methods included from SubGenerating

#gen_nested, #gen_top_level, #generate

Methods inherited from ExprGenerator

#gen_intermediate, #gen_intermediate_assert, #gen_intermediate_disallow, #gen_intermediate_skip, #gen_token, #initialize

Constructor Details

This class inherits a constructor from Rattler::Compiler::ParserGenerator::ExprGenerator

Class Method Details

.nested(*args) ⇒ Object



24
25
26
# File 'lib/rattler/compiler/parser_generator/attributed_sequence_generator.rb', line 24

def AttributedSequenceGenerator.nested(*args)
  NestedAttributedSequenceGenerator.new(*args)
end

.top_level(*args) ⇒ Object



33
34
35
# File 'lib/rattler/compiler/parser_generator/attributed_sequence_generator.rb', line 33

def AttributedSequenceGenerator.top_level(*args)
  TopLevelAttributedSequenceGenerator.new(*args)
end

Instance Method Details

#gen_basic(sequence, scope = ParserScope.empty) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/rattler/compiler/parser_generator/attributed_sequence_generator.rb', line 9

def gen_basic(sequence, scope = ParserScope.empty)
  with_backtracking do
    gen_children_capturing(sequence, scope.nest) do |last_child, scope|
      gen_nested last_child, :basic, scope
    end
  end
end