Class: Rattler::BackEnd::ParserGenerator::FailGenerator

Inherits:
ExprGenerator
  • Object
show all
Defined in:
lib/rattler/back_end/parser_generator/fail_generator.rb

Direct Known Subclasses

NestedFailGenerator, TopLevelFailGenerator

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ExprGenerator

#gen_direct_action, #gen_dispatch_action, #gen_intermediate, #gen_intermediate_assert, #gen_intermediate_disallow, #gen_intermediate_skip, #gen_token, #initialize

Methods included from Parsers

define

Constructor Details

This class inherits a constructor from Rattler::BackEnd::ParserGenerator::ExprGenerator

Class Method Details

.nested(*args) ⇒ Object



38
39
40
# File 'lib/rattler/back_end/parser_generator/fail_generator.rb', line 38

def FailGenerator.nested(*args)
  NestedFailGenerator.new(*args)
end

.top_level(*args) ⇒ Object



47
48
49
# File 'lib/rattler/back_end/parser_generator/fail_generator.rb', line 47

def FailGenerator.top_level(*args)
  TopLevelFailGenerator.new(*args)
end

Instance Method Details

#gen_basic(fail, scope = {}) ⇒ Object

:nodoc:



8
9
10
11
12
13
14
# File 'lib/rattler/back_end/parser_generator/fail_generator.rb', line 8

def gen_basic(fail, scope={})
  case fail.attrs[:type]
  when :expr  then gen_fail_expr fail.message
  when :rule  then gen_fail_rule fail.message
  when :parse then gen_fail_parse fail.message
  end
end