public class ParseException extends EvalError
| Modifier and Type | Field and Description |
|---|---|
Token |
currentToken
This is the last token that has been consumed successfully.
|
int[][] |
expectedTokenSequences
Each entry in this array is an array of integers.
|
java.lang.String[][] |
expectedTokenSequencesLoc
Source locations of each expected token sequence, parallel to expectedTokenSequences.
|
java.lang.String |
location
The grammar expansion in which the error arose.
|
java.lang.String[] |
tokenImage
This is a reference to the "tokenImage" array of the generated
parser within which the parse error occurred.
|
| Constructor and Description |
|---|
ParseException()
The following constructors are for use by you for whatever
purpose you can think of.
|
ParseException(java.lang.String message)
Constructor with message.
|
ParseException(java.lang.String message,
java.lang.Throwable cause) |
ParseException(Token currentTokenVal,
int[][] expectedTokenSequencesVal,
java.lang.String[][] expectedTokenSequencesLocVal,
java.lang.String[] tokenImageVal,
java.lang.String locationVal)
This constructor is used by the method "generateParseException"
in the generated parser.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getErrorLineNumber() |
java.lang.String |
getErrorSourceFile()
Accessor method to retrieve source file info.
|
java.lang.String |
getErrorText() |
java.lang.String |
getMessage()
Print the error with line number and stack trace.
|
java.lang.String |
getMessage(boolean debug) |
void |
setErrorSourceFile(java.lang.String file)
Used to add source file info to exception
|
java.lang.String |
toString() |
getRawMessage, getScriptStackTrace, prependMessage, reThrowpublic Token currentToken
public int[][] expectedTokenSequences
public java.lang.String[] tokenImage
public java.lang.String[][] expectedTokenSequencesLoc
public java.lang.String location
public ParseException(Token currentTokenVal, int[][] expectedTokenSequencesVal, java.lang.String[][] expectedTokenSequencesLocVal, java.lang.String[] tokenImageVal, java.lang.String locationVal)
public ParseException()
public ParseException(java.lang.String message)
public ParseException(java.lang.String message,
java.lang.Throwable cause)
public void setErrorSourceFile(java.lang.String file)
file - source filepublic java.lang.String getErrorSourceFile()
getErrorSourceFile in class EvalErrorpublic int getErrorLineNumber()
getErrorLineNumber in class EvalErrorpublic java.lang.String getErrorText()
getErrorText in class EvalErrorpublic java.lang.String getMessage()
EvalErrorgetMessage in class EvalErrorpublic java.lang.String getMessage(boolean debug)
public java.lang.String toString()
toString in class java.lang.Throwable