Merge pull request #502 from sharwell/fix-480

Mark Recognizer.getTokenErrorDisplay as deprecated (fixes #480)
This commit is contained in:
Terence Parr 2014-03-21 09:37:02 -07:00
commit c6e6ccde4c
1 changed files with 6 additions and 0 deletions

View File

@ -182,7 +182,13 @@ public abstract class Recognizer<Symbol, ATNInterpreter extends ATNSimulator> {
* the token). This is better than forcing you to override a method in * the token). This is better than forcing you to override a method in
* your token objects because you don't have to go modify your lexer * your token objects because you don't have to go modify your lexer
* so that it creates a new Java type. * so that it creates a new Java type.
*
* @deprecated This method is not called by the ANTLR 4 Runtime. Specific
* implementations of {@link ANTLRErrorStrategy} may provide a similar
* feature when necessary. For example, see
* {@link DefaultErrorStrategy#getTokenErrorDisplay}.
*/ */
@Deprecated
public String getTokenErrorDisplay(Token t) { public String getTokenErrorDisplay(Token t) {
if ( t==null ) return "<no token>"; if ( t==null ) return "<no token>";
String s = t.getText(); String s = t.getText();