Exception: Antlr4::Runtime::InputMismatchException

Inherits:
RecognitionException show all
Defined in:
lib/antlr4/runtime/input_mismatch_exception.rb

Instance Attribute Summary

Attributes inherited from RecognitionException

#context, #input, #offending_state, #offending_token, #recognizer

Class Method Summary collapse

Methods inherited from RecognitionException

#expected_tokens

Class Method Details

.create(recog, state = nil) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/antlr4/runtime/input_mismatch_exception.rb', line 4

def self.create(recog, state = nil)
  result = InputMismatchException.new

  result.offending_state = -1
  result.context = recog._ctx
  result.input = recog._input
  result.recognizer = recog
  result.offending_state = recog._state_number unless recog.nil?

  result.offending_token = recog.current_token unless recog.nil?
  result.offending_state = state unless state.nil?
  result
end