public class RecognizerErrorHandler extends Object
| Constructor and Description |
|---|
RecognizerErrorHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageToHistory(String msg) |
static String |
getErrorMessage(org.slf4j.Logger log,
org.antlr.runtime.BaseRecognizer recognizer,
org.antlr.runtime.RecognitionException e,
String superMessage,
String[] tokenNames)
Format an error message as expected by ANTLR.
|
List<String> |
getErrorMessages() |
static String |
makeUserMsg(org.antlr.runtime.RecognitionException e,
String msg)
Simplify error message text for end users.
|
static String |
toString(org.antlr.runtime.Token token,
String[] tokenNames)
Token traces are slightly more readable if numeric type is translated to a readable string.
|
public static String getErrorMessage(org.slf4j.Logger log, org.antlr.runtime.BaseRecognizer recognizer, org.antlr.runtime.RecognitionException e, String superMessage, String[] tokenNames)
log - the logger to use at debug timerecognizer - the lexer or parser who generated the errore - the exception that occuredsuperMessage - the error message that the super class generatedtokenNames - list of token namespublic static String makeUserMsg(org.antlr.runtime.RecognitionException e, String msg)
e - exception that occurredmsg - as formatted by ANTLRpublic void addMessageToHistory(String msg)
msg - the last error message recordedpublic static String toString(org.antlr.runtime.Token token, String[] tokenNames)
token - a lexer tokentokenNames - the list of token namesCopyright © 2021 LegSem. All rights reserved.