public class SyntaxErrorReporter
extends org.antlr.v4.runtime.BaseErrorListener
printOnConsole
flag.
It supports beautiful error message via SyntaxErrorReporter.SyntaxError.getBeatifulErrorMessage(String[])
.
Modifier and Type | Class and Description |
---|---|
static class |
SyntaxErrorReporter.ParserException |
static class |
SyntaxErrorReporter.SyntaxError
This class represents an ANTLR4 error message.
|
Constructor and Description |
---|
SyntaxErrorReporter() |
SyntaxErrorReporter(boolean printOnConsole,
boolean throwDirect) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasErrors()
Returns true, iff syntax errors were discovered by this listener.
|
void |
syntaxError(org.antlr.v4.runtime.Recognizer<?,?> recognizer,
java.lang.Object offendingSymbol,
int line,
int charPositionInLine,
java.lang.String msg,
org.antlr.v4.runtime.RecognitionException e) |
void |
throwException()
Throws an exception if an error has occured.
|
void |
throwException(java.lang.String[] lines)
Throws an exception if an error has occured, like
throwException() ,
but with an beautiful exception message based on input lines . |
void |
throwException(java.util.function.Supplier<java.lang.String[]> lines)
Throws an exception if an error has occured, like
throwException() ,
but with an beautiful exception message based on input lines . |
public SyntaxErrorReporter()
public SyntaxErrorReporter(boolean printOnConsole, boolean throwDirect)
public void syntaxError(org.antlr.v4.runtime.Recognizer<?,?> recognizer, @Nullable java.lang.Object offendingSymbol, int line, int charPositionInLine, java.lang.String msg, org.antlr.v4.runtime.RecognitionException e)
syntaxError
in interface org.antlr.v4.runtime.ANTLRErrorListener
syntaxError
in class org.antlr.v4.runtime.BaseErrorListener
public boolean hasErrors()
public void throwException()
ParseException
hasErrors()
public void throwException(java.lang.String[] lines)
throwException()
,
but with an beautiful exception message based on input lines
.ParseException
hasErrors()
public void throwException(java.util.function.Supplier<java.lang.String[]> lines)
throwException()
,
but with an beautiful exception message based on input lines
.ParseException
hasErrors()
Copyright © 2003-2019 The KeY-Project.