Class: Rattler::Compiler::ParserGenerator::SuperGenerator
- Inherits:
-
ExprGenerator
- Object
- ExprGenerator
- Rattler::Compiler::ParserGenerator::SuperGenerator
show all
- Defined in:
- lib/rattler/compiler/parser_generator/super_generator.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#gen_intermediate, #gen_intermediate_assert, #gen_intermediate_disallow, #gen_intermediate_skip, #initialize
Class Method Details
.top_level(*args) ⇒ Object
Instance Method Details
#gen_assert(*_) ⇒ Object
12
13
14
15
16
17
|
# File 'lib/rattler/compiler/parser_generator/super_generator.rb', line 12
def gen_assert(*_)
expr :block do
lookahead { (@g << "#{result_name} = (super && true)").newline }
@g << result_name
end
end
|
#gen_basic(*_) ⇒ Object
8
9
10
|
# File 'lib/rattler/compiler/parser_generator/super_generator.rb', line 8
def gen_basic(*_)
@g << 'super'
end
|
#gen_disallow(*_) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/rattler/compiler/parser_generator/super_generator.rb', line 19
def gen_disallow(*_)
expr :block do
lookahead { (@g << "#{result_name} = !super").newline }
@g << result_name
end
end
|
#gen_skip(*_) ⇒ Object
30
31
32
|
# File 'lib/rattler/compiler/parser_generator/super_generator.rb', line 30
def gen_skip(*_)
expr { @g << 'super && true' }
end
|
#gen_token(*_) ⇒ Object
26
27
28
|
# File 'lib/rattler/compiler/parser_generator/super_generator.rb', line 26
def gen_token(*_)
@g << 'super.to_s'
end
|