Class: Antlr4::Runtime::BailErrorStrategy

Inherits:
DefaultErrorStrategy show all
Defined in:
lib/antlr4/runtime/bail_error_strategy.rb

Instance Method Summary collapse

Methods inherited from DefaultErrorStrategy

#begin_error_condition, #consume_until, #end_error_condition, #error_recovery_mode?, #error_recovery_set, #escape_ws_and_quote, #expected_tokens, #get_missing_symbol, #initialize, #report_error, #report_failed_predicate, #report_input_mismatch, #report_match, #report_missing_token, #report_no_viable_alternative, #report_unwanted_token, #reset, #single_token_deletion, #single_token_insertion, #symbol_text, #symbol_type, #token_error_display

Methods inherited from ANTLRErrorStrategy

#in_error_recovery_mode, #report_error, #report_match, #reset

Constructor Details

This class inherits a constructor from Antlr4::Runtime::DefaultErrorStrategy

Instance Method Details

#recover(recognizer, e) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/antlr4/runtime/bail_error_strategy.rb', line 6

def recover(recognizer, e)
  context = recognizer.getContext
  until context.nil?
    context = context.get_parent
    context.exception = e
  end

  raise ParseCancellationException(e)
end

#recover_in_line(recognizer) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/antlr4/runtime/bail_error_strategy.rb', line 16

def recover_in_line(recognizer)
  e = InputMismatchException.new recognizer
  context = recognizer.getContext
  until context.nil?
    context = context.get_parent
    context.exception = e
  end

  raise ParseCancellationException(e)
end

#sync(recognizer) ⇒ Object



27
28
29
# File 'lib/antlr4/runtime/bail_error_strategy.rb', line 27

def sync(recognizer)
  ;
end