Class: Rattler::Compiler::ParserGenerator::AssertGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ExprGenerator

#gen_intermediate_disallow, #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/assert_generator.rb', line 55

def AssertGenerator.nested(*args)
  NestedAssertGenerator.new(*args)
end

.top_level(*args) ⇒ Object



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

def AssertGenerator.top_level(*args)
  TopLevelAssertGenerator.new(*args)
end

Instance Method Details

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



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

def gen_assert(assert, scope = ParserScope.empty)
  gen_basic assert, scope
end

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

:nodoc:



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

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

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



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

def gen_disallow(assert, scope = ParserScope.empty)
  @g << 'false'
end

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



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

def gen_intermediate(assert, scope = ParserScope.empty)
  generate assert.child, :intermediate_assert, scope
end

#gen_intermediate_assert(assert, scope = ParserScope.empty) ⇒ Object



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

def gen_intermediate_assert(assert, scope = ParserScope.empty)
  gen_intermediate assert, scope
end

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



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

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

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



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

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

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



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

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