Class: Rattler::Compiler::ParserGenerator::SemanticActionGenerator
Class Method Summary
collapse
Instance Method Summary
collapse
#gen_nested, #gen_top_level, #generate
#gen_intermediate, #gen_intermediate_disallow, #initialize
Class Method Details
.top_level(*args) ⇒ Object
Instance Method Details
#gen_assert(action, scope = ParserScope.empty) ⇒ Object
13
14
15
|
# File 'lib/rattler/compiler/parser_generator/semantic_action_generator.rb', line 13
def gen_assert(action, scope = ParserScope.empty)
expr { @g.suffix(' && true') { gen_intermediate_assert action, scope } }
end
|
#gen_basic(action, scope = ParserScope.empty) ⇒ Object
9
10
11
|
# File 'lib/rattler/compiler/parser_generator/semantic_action_generator.rb', line 9
def gen_basic(action, scope = ParserScope.empty)
expr { @g << action.bindable_code.bind(scope) }
end
|
#gen_disallow(action, scope = ParserScope.empty) ⇒ Object
17
18
19
20
|
# File 'lib/rattler/compiler/parser_generator/semantic_action_generator.rb', line 17
def gen_disallow(action, scope = ParserScope.empty)
@g << '!'
gen_nested action, :basic, scope
end
|
30
31
32
|
# File 'lib/rattler/compiler/parser_generator/semantic_action_generator.rb', line 30
def gen_intermediate_assert(action, scope = ParserScope.empty)
gen_nested action, :basic, scope
end
|
34
35
36
|
# File 'lib/rattler/compiler/parser_generator/semantic_action_generator.rb', line 34
def gen_intermediate_skip(action, scope = ParserScope.empty)
gen_nested action, :basic, scope
end
|
#gen_skip(action, scope = ParserScope.empty) ⇒ Object
26
27
28
|
# File 'lib/rattler/compiler/parser_generator/semantic_action_generator.rb', line 26
def gen_skip(action, scope = ParserScope.empty)
expr { @g.suffix('; true') { gen_top_level action, :basic, scope } }
end
|
#gen_token(action, scope = ParserScope.empty) ⇒ Object
22
23
24
|
# File 'lib/rattler/compiler/parser_generator/semantic_action_generator.rb', line 22
def gen_token(action, scope = ParserScope.empty)
@g.suffix('.to_s') { gen_nested action, :basic, scope }
end
|