Class: Rattler::BackEnd::ParserGenerator::AssertGenerator
- Inherits:
-
ExprGenerator
- Object
- ExprGenerator
- Rattler::BackEnd::ParserGenerator::AssertGenerator
show all
- Defined in:
- lib/rattler/back_end/parser_generator/assert_generator.rb
Class Method Summary
collapse
Instance Method Summary
collapse
-
#gen_assert(assert, scope = {}) ⇒ Object
-
#gen_basic(assert, scope = {}) ⇒ Object
-
#gen_direct_action(assert, code, scope = {}) ⇒ Object
-
#gen_disallow(assert, scope = {}) ⇒ Object
-
#gen_dispatch_action(assert, code, scope = {}) ⇒ Object
-
#gen_intermediate(assert, scope = {}) ⇒ Object
-
#gen_intermediate_assert(assert, scope = {}) ⇒ Object
-
#gen_intermediate_skip(assert, scope = {}) ⇒ Object
-
#gen_skip(assert, scope = {}) ⇒ Object
-
#gen_token(assert, scope = {}) ⇒ Object
#gen_intermediate_disallow, #initialize
Methods included from Parsers
define
Class Method Details
.top_level(*args) ⇒ Object
Instance Method Details
#gen_assert(assert, scope = {}) ⇒ Object
12
13
14
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 12
def gen_assert(assert, scope={})
gen_basic assert, scope
end
|
#gen_basic(assert, scope = {}) ⇒ Object
8
9
10
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 8
def gen_basic(assert, scope={})
generate assert.child, :assert, scope
end
|
#gen_direct_action(assert, code, scope = {}) ⇒ Object
28
29
30
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 28
def gen_direct_action(assert, code, scope={})
expr(:block) { gen_action assert, "(#{code.bind scope, []})", scope }
end
|
#gen_disallow(assert, scope = {}) ⇒ Object
16
17
18
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 16
def gen_disallow(assert, scope={})
@g << 'false'
end
|
#gen_dispatch_action(assert, code, scope = {}) ⇒ Object
24
25
26
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 24
def gen_dispatch_action(assert, code, scope={})
expr(:block) { gen_action assert, code.bind(scope, '[]'), scope }
end
|
36
37
38
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 36
def gen_intermediate(assert, scope={})
generate assert.child, :intermediate_assert, scope
end
|
40
41
42
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 40
def gen_intermediate_assert(assert, scope={})
gen_intermediate assert, scope
end
|
44
45
46
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 44
def gen_intermediate_skip(assert, scope={})
gen_intermediate assert, scope
end
|
#gen_skip(assert, scope = {}) ⇒ Object
20
21
22
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 20
def gen_skip(assert, scope={})
gen_basic assert, scope
end
|
#gen_token(assert, scope = {}) ⇒ Object
32
33
34
|
# File 'lib/rattler/back_end/parser_generator/assert_generator.rb', line 32
def gen_token(assert, scope={})
expr(:block) { gen_action assert, "''", scope }
end
|