public interface ANTLRErrorListener
Modifier and Type | Method and Description |
---|---|
void |
reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet ambigAlts,
ATNConfigSet configs)
Called when the parser detects a true ambiguity: an input
sequence can be matched literally by two or more pass through
the grammar.
|
void |
reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
ATNConfigSet configs) |
void |
reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
ATNConfigSet configs)
Called by the parser when it find a conflict that is resolved
by retrying the parse with full context.
|
void |
syntaxError(Recognizer<?,?> recognizer,
Object offendingSymbol,
int line,
int charPositionInLine,
String msg,
RecognitionException e)
Upon syntax error, notify any interested parties.
|
void syntaxError(Recognizer<?,?> recognizer, @Nullable Object offendingSymbol, int line, int charPositionInLine, String msg, @Nullable RecognitionException e)
recognizer
- What parser got the error. From this
object, you can access the context as well
as the input stream.offendingSymbol
- The offending token in the input token
stream, unless recognizer is a lexer (then it's null) If
no viable alternative error, e has token at which we
started production for the decision.line
- At what line in input to the error occur? This always refers to
stopTokenIndexcharPositionInLine
- At what character position within that line did the error occur.msg
- The message to emite
- The exception generated by the parser that led to
the reporting of an error. It is null in the case where
the parser was able to recover in line without exiting the
surrounding rule.void reportAmbiguity(@NotNull Parser recognizer, DFA dfa, int startIndex, int stopIndex, @NotNull BitSet ambigAlts, @NotNull ATNConfigSet configs)
void reportAttemptingFullContext(@NotNull Parser recognizer, @NotNull DFA dfa, int startIndex, int stopIndex, @NotNull ATNConfigSet configs)
void reportContextSensitivity(@NotNull Parser recognizer, @NotNull DFA dfa, int startIndex, int stopIndex, @NotNull ATNConfigSet configs)
Copyright © 1992-2013 ANTLR. All Rights Reserved.