Class: Rattler::BackEnd::ParserGenerator::ESymbolGenerator
- Inherits:
-
ExprGenerator
- Object
- ExprGenerator
- Rattler::BackEnd::ParserGenerator::ESymbolGenerator
show all
- Defined in:
- lib/rattler/back_end/parser_generator/e_symbol_generator.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#gen_intermediate, #gen_intermediate_assert, #gen_intermediate_disallow, #gen_intermediate_skip, #initialize
Methods included from Parsers
define
Class Method Details
.top_level(*args) ⇒ Object
Instance Method Details
#gen_basic(*_) ⇒ Object
Also known as:
gen_assert, gen_skip
8
9
10
|
# File 'lib/rattler/back_end/parser_generator/e_symbol_generator.rb', line 8
def gen_basic(*_)
@g << 'true'
end
|
#gen_direct_action(eof, code, scope = {}) ⇒ Object
22
23
24
|
# File 'lib/rattler/back_end/parser_generator/e_symbol_generator.rb', line 22
def gen_direct_action(eof, code, scope={})
expr { @g << code.bind(scope, []) }
end
|
#gen_disallow(*_) ⇒ Object
14
15
16
|
# File 'lib/rattler/back_end/parser_generator/e_symbol_generator.rb', line 14
def gen_disallow(*_)
@g << 'false'
end
|
#gen_dispatch_action(eof, code, scope = {}) ⇒ Object
18
19
20
|
# File 'lib/rattler/back_end/parser_generator/e_symbol_generator.rb', line 18
def gen_dispatch_action(eof, code, scope={})
@g << code.bind(scope, '[]')
end
|
#gen_token(*_) ⇒ Object
26
27
28
|
# File 'lib/rattler/back_end/parser_generator/e_symbol_generator.rb', line 26
def gen_token(*_)
@g << "''"
end
|