Class: Rattler::Compiler::ParserGenerator::ESymbolGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ExprGenerator

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

Constructor Details

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

Class Method Details

.nested(*args) ⇒ Object



31
32
33
# File 'lib/rattler/compiler/parser_generator/e_symbol_generator.rb', line 31

def ESymbolGenerator.nested(*args)
  NestedESymbolGenerator.new(*args)
end

.top_level(*args) ⇒ Object



40
41
42
# File 'lib/rattler/compiler/parser_generator/e_symbol_generator.rb', line 40

def ESymbolGenerator.top_level(*args)
  TopLevelESymbolGenerator.new(*args)
end

Instance Method Details

#gen_basic(*_) ⇒ Object Also known as: gen_assert, gen_skip

:nodoc:



8
9
10
# File 'lib/rattler/compiler/parser_generator/e_symbol_generator.rb', line 8

def gen_basic(*_)
  @g << 'true'
end

#gen_disallow(*_) ⇒ Object



14
15
16
# File 'lib/rattler/compiler/parser_generator/e_symbol_generator.rb', line 14

def gen_disallow(*_)
  @g << 'false'
end

#gen_token(*_) ⇒ Object



18
19
20
# File 'lib/rattler/compiler/parser_generator/e_symbol_generator.rb', line 18

def gen_token(*_)
  @g << "''"
end