Class: Rattler::Compiler::ParserGenerator::FailGenerator
- Inherits:
-
ExprGenerator
- Object
- ExprGenerator
- Rattler::Compiler::ParserGenerator::FailGenerator
- Defined in:
- lib/rattler/compiler/parser_generator/fail_generator.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#gen_basic(fail, scope = ParserScope.empty) ⇒ Object
:nodoc:.
- #gen_skip(fail, scope = ParserScope.empty) ⇒ Object
Methods inherited from ExprGenerator
#gen_intermediate, #gen_intermediate_assert, #gen_intermediate_disallow, #gen_intermediate_skip, #gen_token, #initialize
Constructor Details
This class inherits a constructor from Rattler::Compiler::ParserGenerator::ExprGenerator
Class Method Details
.nested(*args) ⇒ Object
42 43 44 |
# File 'lib/rattler/compiler/parser_generator/fail_generator.rb', line 42 def FailGenerator.nested(*args) NestedFailGenerator.new(*args) end |
.top_level(*args) ⇒ Object
51 52 53 |
# File 'lib/rattler/compiler/parser_generator/fail_generator.rb', line 51 def FailGenerator.top_level(*args) TopLevelFailGenerator.new(*args) end |
Instance Method Details
#gen_basic(fail, scope = ParserScope.empty) ⇒ Object
:nodoc:
8 9 10 11 12 13 14 |
# File 'lib/rattler/compiler/parser_generator/fail_generator.rb', line 8 def gen_basic(fail, scope = ParserScope.empty) case fail.attrs[:type] when :expr then gen_fail_expr fail. when :rule then gen_fail_rule fail. when :parse then gen_fail_parse fail. end end |
#gen_skip(fail, scope = ParserScope.empty) ⇒ Object
16 17 18 |
# File 'lib/rattler/compiler/parser_generator/fail_generator.rb', line 16 def gen_skip(fail, scope = ParserScope.empty) gen_basic fail, scope end |