Package org.antlr.v4.tool
Class ErrorManager
- java.lang.Object
-
- org.antlr.v4.tool.ErrorManager
-
public class ErrorManager extends Object
-
-
Field Summary
Fields Modifier and Type Field Description interrorsSet<ErrorType>errorTypesAll errors that have been generatedstatic StringFORMATS_DIRTooltoolintwarnings
-
Constructor Summary
Constructors Constructor Description ErrorManager(Tool tool)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidemit(ErrorType etype, ANTLRMessage msg)static voidfatalInternalError(String error, Throwable e)booleanformatWantsSingleLineMessage()org.stringtemplate.v4.STgetLocationFormat()Return a StringTemplate that refers to the current format used for emitting messages.org.stringtemplate.v4.STgetMessageFormat()org.stringtemplate.v4.STgetMessageTemplate(ANTLRMessage msg)intgetNumErrors()org.stringtemplate.v4.STgetReportFormat(ErrorSeverity severity)voidgrammarError(ErrorType etype, String fileName, org.antlr.runtime.Token token, Object... args)voidinfo(String msg)static voidinternalError(String error)static voidinternalError(String error, Throwable e)voidleftRecursionCycles(String fileName, Collection<? extends Collection<Rule>> cycles)static voidpanic()static voidpanic(String msg)voidpanic(ErrorType errorType, Object... args)voidresetErrorState()voidsetFormat(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".voidsyntaxError(ErrorType etype, String fileName, org.antlr.runtime.Token token, org.antlr.runtime.RecognitionException antlrException, Object... args)voidtoolError(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.voidtoolError(ErrorType errorType, Throwable e, Object... args)protected booleanverifyFormat()Verify the message format template group
-
-
-
Field Detail
-
FORMATS_DIR
public static final String FORMATS_DIR
- See Also:
- Constant Field Values
-
tool
public Tool tool
-
errors
public int errors
-
warnings
public int warnings
-
-
Constructor Detail
-
ErrorManager
public ErrorManager(Tool tool)
-
-
Method Detail
-
resetErrorState
public void resetErrorState()
-
getMessageTemplate
public org.stringtemplate.v4.ST getMessageTemplate(ANTLRMessage msg)
-
getLocationFormat
public org.stringtemplate.v4.ST getLocationFormat()
Return a StringTemplate that refers to the current format used for emitting messages.
-
getReportFormat
public org.stringtemplate.v4.ST getReportFormat(ErrorSeverity severity)
-
getMessageFormat
public org.stringtemplate.v4.ST getMessageFormat()
-
formatWantsSingleLineMessage
public boolean formatWantsSingleLineMessage()
-
info
public void info(String msg)
-
syntaxError
public void syntaxError(ErrorType etype, String fileName, org.antlr.runtime.Token token, org.antlr.runtime.RecognitionException antlrException, Object... args)
-
internalError
public static void internalError(String error)
-
toolError
public 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.- Parameters:
errorType- The Message Descriptorargs- The arguments to pass to the StringTemplate
-
grammarError
public void grammarError(ErrorType etype, String fileName, org.antlr.runtime.Token token, Object... args)
-
leftRecursionCycles
public void leftRecursionCycles(String fileName, Collection<? extends Collection<Rule>> cycles)
-
getNumErrors
public int getNumErrors()
-
emit
public void emit(ErrorType etype, ANTLRMessage msg)
-
setFormat
public 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".
-
verifyFormat
protected boolean verifyFormat()
Verify the message format template group
-
panic
public static void panic(String msg)
-
panic
public static void panic()
-
-