public class BaseErrorListener extends Object implements ANTLRErrorListener
Constructor and Description |
---|
BaseErrorListener() |
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.
|
public void syntaxError(Recognizer<?,?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e)
ANTLRErrorListener
syntaxError
in interface ANTLRErrorListener
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.public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet ambigAlts, ATNConfigSet configs)
ANTLRErrorListener
reportAmbiguity
in interface ANTLRErrorListener
public void reportAttemptingFullContext(Parser recognizer, DFA dfa, int startIndex, int stopIndex, ATNConfigSet configs)
reportAttemptingFullContext
in interface ANTLRErrorListener
public void reportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, ATNConfigSet configs)
ANTLRErrorListener
reportContextSensitivity
in interface ANTLRErrorListener
Copyright © 2012. All Rights Reserved.