public class ParseException extends CoffeeGrinderException
Parse exceptions are generally errors in the API, or uses of the API.
Constructor and Description |
---|
ParseException(java.lang.String code,
java.lang.String message)
An parse exception with a message.
|
ParseException(java.lang.String code,
java.lang.String message,
java.lang.Throwable cause)
An parse exception with an underlying cause.
|
Modifier and Type | Method and Description |
---|---|
static ParseException |
attemptToContinueInvalidParse()
Raised if an attempt is made to continue after an invalid parse.
|
static ParseException |
attemptToContinueWithIncompatibleParser()
Raised if an attempt is made to continue with an incompatible parser.
|
static ParseException |
internalError(java.lang.String reason)
Raised if an internal error occurs.
|
static ParseException |
invalidInputForGLL()
Raised if an attempt is made to parse an invalid input.
|
static ParseException |
invalidInputForRegex()
Raised if an attempt is made to parse an invalid input.
|
static ParseException |
seedNotInGrammar(java.lang.String seed)
Raised if the selected seed token is not in the grammar
|
getCode
public ParseException(java.lang.String code, java.lang.String message)
code
- the codemessage
- the messagepublic ParseException(java.lang.String code, java.lang.String message, java.lang.Throwable cause)
code
- the codemessage
- the messagecause
- the causepublic static ParseException seedNotInGrammar(java.lang.String seed)
seed
- the seed namepublic static ParseException attemptToContinueInvalidParse()
public static ParseException internalError(java.lang.String reason)
reason
- a detail message.public static ParseException invalidInputForGLL()
The GLL parser can only parse characters, this exception is raised if it is used to parse any other kind of tokens.
public static ParseException invalidInputForRegex()
Regular expressions are only supported over a sequence of tokens.
public static ParseException attemptToContinueWithIncompatibleParser()