Class: Rattler::Compiler::ParserGenerator::DisallowGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ExprGenerator

#gen_intermediate_assert, #initialize

Constructor Details

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

Class Method Details

.nested(*args) ⇒ Object



55
56
57
# File 'lib/rattler/compiler/parser_generator/disallow_generator.rb', line 55

def DisallowGenerator.nested(*args)
  NestedDisallowGenerator.new(*args)
end

.top_level(*args) ⇒ Object



65
66
67
# File 'lib/rattler/compiler/parser_generator/disallow_generator.rb', line 65

def DisallowGenerator.top_level(*args)
  TopLevelDisallowGenerator.new(*args)
end

Instance Method Details

#gen_assert(disallow, scope = ParserScope.empty) ⇒ Object



12
13
14
# File 'lib/rattler/compiler/parser_generator/disallow_generator.rb', line 12

def gen_assert(disallow, scope = ParserScope.empty)
  @g << 'false'
end

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

:nodoc:



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

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

#gen_disallow(disallow, scope = ParserScope.empty) ⇒ Object



16
17
18
# File 'lib/rattler/compiler/parser_generator/disallow_generator.rb', line 16

def gen_disallow(disallow, scope = ParserScope.empty)
  gen_basic disallow, scope
end

#gen_intermediate(disallow, scope = ParserScope.empty) ⇒ Object



28
29
30
# File 'lib/rattler/compiler/parser_generator/disallow_generator.rb', line 28

def gen_intermediate(disallow, scope = ParserScope.empty)
  generate disallow.child, :intermediate_disallow, scope
end

#gen_intermediate_disallow(disallow, scope = ParserScope.empty) ⇒ Object



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

def gen_intermediate_disallow(disallow, scope = ParserScope.empty)
  gen_intermediate disallow, scope
end

#gen_intermediate_skip(disallow, scope = ParserScope.empty) ⇒ Object



36
37
38
# File 'lib/rattler/compiler/parser_generator/disallow_generator.rb', line 36

def gen_intermediate_skip(disallow, scope = ParserScope.empty)
  gen_intermediate disallow, scope
end

#gen_skip(disallow, scope = ParserScope.empty) ⇒ Object



20
21
22
# File 'lib/rattler/compiler/parser_generator/disallow_generator.rb', line 20

def gen_skip(disallow, scope = ParserScope.empty)
  gen_basic disallow, scope
end

#gen_token(disallow, scope = ParserScope.empty) ⇒ Object



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

def gen_token(disallow, scope = ParserScope.empty)
  expr(:block) { gen_action disallow, "''", scope }
end