Class: Rattler::Compiler::ParserGenerator::TokenGenerator

Inherits:
ExprGenerator
  • Object
show all
Includes:
PredicatePropogating, SkipPropogating, TokenPropogating
Defined in:
lib/rattler/compiler/parser_generator/token_generator.rb

Direct Known Subclasses

NestedTokenGenerator, TopLevelTokenGenerator

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SkipPropogating

#gen_intermediate_skip, #gen_skip

Methods included from TokenPropogating

#gen_token

Methods included from PredicatePropogating

#gen_assert, #gen_disallow, #gen_intermediate_assert, #gen_intermediate_disallow

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



22
23
24
# File 'lib/rattler/compiler/parser_generator/token_generator.rb', line 22

def TokenGenerator.nested(*args)
  NestedTokenGenerator.new(*args)
end

.top_level(*args) ⇒ Object



32
33
34
# File 'lib/rattler/compiler/parser_generator/token_generator.rb', line 32

def TokenGenerator.top_level(*args)
  TopLevelTokenGenerator.new(*args)
end

Instance Method Details

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



11
12
13
# File 'lib/rattler/compiler/parser_generator/token_generator.rb', line 11

def gen_basic(token, scope = ParserScope.empty)
  generate token.child, :token, scope
end