RecognitionException

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.

Constructors

this
this(InterfaceRecognizer recognizer, IntStream input, ParserRuleContext ctx)
Undocumented in source.
this
this(string message, InterfaceRecognizer recognizer, IntStream input, ParserRuleContext ctx)
Undocumented in source.

Members

Functions

getCtx
RuleContext getCtx()

Gets the {@link RuleContext} at the time this exception was thrown.

getExpectedTokens
IntervalSet getExpectedTokens()

Gets the set of input symbols which could potentially follow the previously matched symbol at the time this exception was thrown.

getInputStream
IntStream getInputStream()
Undocumented in source. Be warned that the author may not have intended to support it.
getOffendingState
int getOffendingState()

Get the ATN state number the parser was in at the time the error occurred. For {@link NoViableAltException} and {@link LexerNoViableAltException} exceptions, this is the {@link DecisionState} number. For others, it is the state whose outgoing edge we couldn't match.

getOffendingToken
Token getOffendingToken()
Undocumented in source. Be warned that the author may not have intended to support it.
getRecognizer
InterfaceRecognizer getRecognizer()

Gets the {@link Recognizer} where this exception occurred.

setOffendingState
void setOffendingState(int offendingState)
Undocumented in source. Be warned that the author may not have intended to support it.
setOffendingToken
void setOffendingToken(Token offendingToken)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

recognizer
InterfaceRecognizer recognizer;

The {@link Recognizer} where this exception originated.

Inherited Members

From RuntimeException

elementDescription
string elementDescription;
Undocumented in source.
msg
string msg()
Undocumented in source. Be warned that the author may not have intended to support it.
initCause
void initCause(Exception e)
Undocumented in source. Be warned that the author may not have intended to support it.
getCause
Exception getCause()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta