Class: Rattler::BackEnd::ParserGenerator::MatchGenerator
- Inherits:
-
ExprGenerator
- Object
- ExprGenerator
- Rattler::BackEnd::ParserGenerator::MatchGenerator
show all
- Defined in:
- lib/rattler/back_end/parser_generator/match_generator.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#gen_direct_action, #gen_dispatch_action, #gen_intermediate, #initialize
Methods included from Parsers
define
Class Method Details
.top_level(*args) ⇒ Object
Instance Method Details
#gen_assert(match, scope = {}) ⇒ Object
12
13
14
15
16
17
|
# File 'lib/rattler/back_end/parser_generator/match_generator.rb', line 12
def gen_assert(match, scope={})
expr do
gen_intermediate_assert match, scope
@g << ' && true'
end
end
|
#gen_basic(match, scope = {}) ⇒ Object
8
9
10
|
# File 'lib/rattler/back_end/parser_generator/match_generator.rb', line 8
def gen_basic(match, scope={})
@g << "@scanner.scan(#{match.re.inspect})"
end
|
#gen_disallow(match, scope = {}) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/rattler/back_end/parser_generator/match_generator.rb', line 19
def gen_disallow(match, scope={})
expr do
gen_intermediate_disallow match, scope
@g << ' && true'
end
end
|
37
38
39
|
# File 'lib/rattler/back_end/parser_generator/match_generator.rb', line 37
def gen_intermediate_assert(match, scope={})
@g << "@scanner.skip(#{/(?=#{match.re.source})/.inspect})"
end
|
41
42
43
|
# File 'lib/rattler/back_end/parser_generator/match_generator.rb', line 41
def gen_intermediate_disallow(match, scope={})
@g << "@scanner.skip(#{/(?!#{match.re.source})/.inspect})"
end
|
45
46
47
|
# File 'lib/rattler/back_end/parser_generator/match_generator.rb', line 45
def gen_intermediate_skip(match, scope={})
@g << "@scanner.skip(#{match.re.inspect})"
end
|
#gen_skip(match, scope = {}) ⇒ Object
30
31
32
33
34
35
|
# File 'lib/rattler/back_end/parser_generator/match_generator.rb', line 30
def gen_skip(match, scope={})
expr do
gen_intermediate_skip match, scope
@g << ' && true'
end
end
|
#gen_token(match, scope = {}) ⇒ Object
26
27
28
|
# File 'lib/rattler/back_end/parser_generator/match_generator.rb', line 26
def gen_token(match, scope={})
gen_basic match, scope
end
|