public class ErrorManager extends Object
Modifier and Type | Field and Description |
---|---|
int |
errors |
Set<ErrorType> |
errorTypes
All errors that have been generated
|
static String |
FORMATS_DIR |
Tool |
tool |
int |
warnings |
Constructor and Description |
---|
ErrorManager(Tool tool) |
Modifier and Type | Method and Description |
---|---|
void |
emit(ErrorType etype,
ANTLRMessage msg) |
static void |
fatalInternalError(String error,
Throwable e) |
boolean |
formatWantsSingleLineMessage() |
org.stringtemplate.v4.ST |
getLocationFormat()
Return a StringTemplate that refers to the current format used for
emitting messages.
|
org.stringtemplate.v4.ST |
getMessageFormat() |
org.stringtemplate.v4.ST |
getMessageTemplate(ANTLRMessage msg) |
int |
getNumErrors() |
org.stringtemplate.v4.ST |
getReportFormat(ErrorSeverity severity) |
void |
grammarError(ErrorType etype,
String fileName,
org.antlr.runtime.Token token,
Object... args) |
void |
info(String msg) |
static void |
internalError(String error) |
static void |
internalError(String error,
Throwable e) |
void |
leftRecursionCycles(String fileName,
Collection<? extends Collection<Rule>> cycles) |
static void |
panic() |
void |
panic(ErrorType errorType,
Object... args) |
static void |
panic(String msg) |
void |
resetErrorState() |
void |
setFormat(String formatName)
The format gets reset either from the Tool if the user supplied a command line option to that effect
Otherwise we just use the default "antlr".
|
void |
syntaxError(ErrorType etype,
String fileName,
org.antlr.runtime.Token token,
org.antlr.runtime.RecognitionException antlrException,
Object... args) |
void |
toolError(ErrorType errorType,
Object... args)
Raise a predefined message with some number of parameters for the StringTemplate but for which there
is no location information possible.
|
void |
toolError(ErrorType errorType,
Throwable e,
Object... args) |
protected boolean |
verifyFormat()
Verify the message format template group
|
public static final String FORMATS_DIR
public Tool tool
public int errors
public int warnings
public ErrorManager(Tool tool)
public void resetErrorState()
public org.stringtemplate.v4.ST getMessageTemplate(ANTLRMessage msg)
public org.stringtemplate.v4.ST getLocationFormat()
public org.stringtemplate.v4.ST getReportFormat(ErrorSeverity severity)
public org.stringtemplate.v4.ST getMessageFormat()
public boolean formatWantsSingleLineMessage()
public void info(String msg)
public void syntaxError(ErrorType etype, String fileName, org.antlr.runtime.Token token, org.antlr.runtime.RecognitionException antlrException, Object... args)
public static void internalError(String error)
public void toolError(ErrorType errorType, Object... args)
errorType
- The Message Descriptorargs
- The arguments to pass to the StringTemplatepublic void grammarError(ErrorType etype, String fileName, org.antlr.runtime.Token token, Object... args)
public void leftRecursionCycles(String fileName, Collection<? extends Collection<Rule>> cycles)
public int getNumErrors()
public void emit(ErrorType etype, ANTLRMessage msg)
public void setFormat(String formatName)
protected boolean verifyFormat()
public static void panic(String msg)
public static void panic()
Copyright © 1992–2021 ANTLR. All rights reserved.