public class ParseError extends java.lang.Exception
Modifier and Type | Field and Description |
---|---|
private Tokenizer.Token |
unexpectedToken |
Constructor and Description |
---|
ParseError(int position,
SearchParseError e)
Constructs a new
ParseError from a SearchParseError . |
ParseError(java.lang.String message)
Constructs a new
ParseError with a generic message. |
ParseError(Tokenizer.Token unexpectedToken)
Constructs a new
ParseError for an unexpected token. |
ParseError(Tokenizer.Token unexpectedToken,
Tokenizer.TokenType expected)
Constructs a new
ParseError for an unexpected token and an expected token. |
Modifier and Type | Method and Description |
---|---|
Tokenizer.Token |
getUnexpectedToken()
Returns the unexpected token, if any.
|
static ParseError |
unexpectedChar(char expected,
char found,
int position)
Constructs a new
ParseError for an unexpected character. |
private final transient Tokenizer.Token unexpectedToken
public ParseError(Tokenizer.Token unexpectedToken)
ParseError
for an unexpected token.unexpectedToken
- the unexpected tokenpublic ParseError(Tokenizer.Token unexpectedToken, Tokenizer.TokenType expected)
ParseError
for an unexpected token and an expected token.unexpectedToken
- the unexpected tokenexpected
- the expected tokenpublic ParseError(int position, SearchParseError e)
ParseError
from a SearchParseError
.position
- the positione
- the causepublic ParseError(java.lang.String message)
ParseError
with a generic message.message
- the detail message. The detail message is saved for later retrieval by the Throwable.getMessage()
method.public Tokenizer.Token getUnexpectedToken()
public static ParseError unexpectedChar(char expected, char found, int position)
ParseError
for an unexpected character.expected
- the expected characterfound
- the found characterposition
- the positionParseError