RecognitionException<StreamType extends IntStream> class
The root of the ANTLR exception hierarchy. In general, ANTLR tracks just 3 kinds of errors: prediction errors, failed predicate errors, and mismatched input errors. In each case, the parser knows where it is in the input, where it is in the ATN, the rule invocation stack, and what kind of problem occurred.
- Inheritance
-
- Object
- Error
- StateError
- RecognitionException
- Implementers
Constructors
-
RecognitionException(Recognizer<
ATNSimulator> ? recognizer, StreamType inputStream, RuleContext? ctx, [String message = ''])
Properties
- ctx → RuleContext?
-
Gets the RuleContext at the time this exception was thrown.
final
- expectedTokens → IntervalSet?
-
Gets the set of input symbols which could potentially follow the
previously matched symbol at the time this exception was thrown.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputStream → StreamType
-
Gets the input stream which is the symbol source for the recognizer where
this exception was thrown.
final
- message → String
-
finalinherited
- offendingState ↔ int
-
Get the ATN state number the parser was in at the time the error
occurred. For NoViableAltException and
LexerNoViableAltException exceptions, this is the
DecisionState number. For others, it is the state whose outgoing
edge we couldn't match.
getter/setter pair
- offendingToken ↔ Token
-
The current Token when an error occurred. Since not all streams
support accessing symbols by index, we have to track the Token
instance itself.
getter/setter pair
-
recognizer
→ Recognizer<
ATNSimulator> ? -
Gets the Recognizer where this exception occurred.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
The stack trace at the point where this error was first thrown.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited