public interface ANTLRErrorStrategy
Modifier and Type | Method and Description |
---|---|
void |
beginErrorCondition(Parser recognizer)
Notify handler that parser has entered an error state.
|
void |
endErrorCondition(Parser recognizer)
Reset the error handler.
|
boolean |
inErrorRecoveryMode(Parser recognizer)
Is the parser in the process of recovering from an error? Upon
a syntax error, the parser enters recovery mode and stays there until
the next successful match of a token.
|
void |
recover(Parser recognizer,
RecognitionException e)
Resynchronize the parser by consuming tokens until we find one
in the resynchronization set--loosely the set of tokens that can follow
the current rule.
|
Token |
recoverInline(Parser recognizer)
When matching elements within alternative, use this method
to recover.
|
void |
reportError(Parser recognizer,
RecognitionException e)
Report any kind of RecognitionException.
|
void |
setTokenFactory(TokenFactory<?> factory)
To create missing tokens, we need a factory
|
void |
sync(Parser recognizer)
Make sure that the current lookahead symbol is consistent with
what were expecting at this point in the ATN.
|
void setTokenFactory(TokenFactory<?> factory)
Token recoverInline(@NotNull Parser recognizer) throws RecognitionException
RecognitionException
void recover(@NotNull Parser recognizer, @Nullable RecognitionException e)
void sync(@NotNull Parser recognizer)
void beginErrorCondition(@NotNull Parser recognizer)
boolean inErrorRecoveryMode(@NotNull Parser recognizer)
void endErrorCondition(@NotNull Parser recognizer)
void reportError(@NotNull Parser recognizer, @Nullable RecognitionException e) throws RecognitionException
RecognitionException
Copyright © 1992-2013 ANTLR. All Rights Reserved.