[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9094]
This commit is contained in:
parrt 2011-10-02 13:18:10 -08:00
parent 05360be562
commit 2a34d00d09
1 changed files with 0 additions and 18 deletions

View File

@ -318,24 +318,6 @@ public abstract class BaseRecognizer extends Recognizer<ParserATNSimulator> {
if ( traceATNStates ) _ctx.trace(atnState); if ( traceATNStates ) _ctx.trace(atnState);
} }
/* In v3, programmers altered error messages by overriding
displayRecognitionError() and possibly getTokenErrorDisplay().
They overrode emitErrorMessage(String) to change where the output goes.
Now, in v4, we're going to use a listener mechanism. This makes it
easier for language applications to have parsers notify them
upon error without having to override the parsers. If you don't specify
a listener, ANTLR calls the v3 legacy displayRecognitionError()
method. All that does is format a message and call emitErrorMessage().
Otherwise, your listener will receive RecognitionException
exceptions and you can do what ever you want with them including
reproducing the same behavior by calling the legacy methods.
(In v4, RecognitionException includes the recognizer object).
Grammar tools can have a listeners without having to worry about
messing up the programmers' error handling.
*/
public void reportConflict(int startIndex, int stopIndex, Set<Integer> alts, public void reportConflict(int startIndex, int stopIndex, Set<Integer> alts,
OrderedHashSet<ATNConfig> configs) {} OrderedHashSet<ATNConfig> configs) {}