Class ParseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.nineml.coffeegrinder.exceptions.CoffeeGrinderException
-
- org.nineml.coffeegrinder.exceptions.ParseException
-
- All Implemented Interfaces:
java.io.Serializable
public class ParseException extends CoffeeGrinderException
Parse exceptions.Parse exceptions are generally errors in the API, or uses of the API.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ParseExceptionattemptToContinueInvalidParse()Raised if an attempt is made to continue after an invalid parse.static ParseExceptionattemptToContinueWithIncompatibleParser()Raised if an attempt is made to continue with an incompatible parser.static ParseExceptioninternalError(java.lang.String reason)Raised if an internal error occurs.static ParseExceptioninvalidInputForGLL()Raised if an attempt is made to parse an invalid input.static ParseExceptioninvalidInputForRegex()Raised if an attempt is made to parse an invalid input.static ParseExceptionseedNotInGrammar(java.lang.String seed)Raised if the selected seed token is not in the grammar-
Methods inherited from class org.nineml.coffeegrinder.exceptions.CoffeeGrinderException
getCode
-
-
-
-
Constructor Detail
-
ParseException
public ParseException(java.lang.String code, java.lang.String message)An parse exception with a message.- Parameters:
code- the codemessage- the message
-
ParseException
public ParseException(java.lang.String code, java.lang.String message, java.lang.Throwable cause)An parse exception with an underlying cause.- Parameters:
code- the codemessage- the messagecause- the cause
-
-
Method Detail
-
seedNotInGrammar
public static ParseException seedNotInGrammar(java.lang.String seed)
Raised if the selected seed token is not in the grammar- Parameters:
seed- the seed name- Returns:
- a ParseException
-
attemptToContinueInvalidParse
public static ParseException attemptToContinueInvalidParse()
Raised if an attempt is made to continue after an invalid parse.- Returns:
- a ParseException
-
internalError
public static ParseException internalError(java.lang.String reason)
Raised if an internal error occurs.- Parameters:
reason- a detail message.- Returns:
- a ParseException
-
invalidInputForGLL
public static ParseException invalidInputForGLL()
Raised if an attempt is made to parse an invalid input.The GLL parser can only parse characters, this exception is raised if it is used to parse any other kind of tokens.
- Returns:
- a ParseException
-
invalidInputForRegex
public static ParseException invalidInputForRegex()
Raised if an attempt is made to parse an invalid input.Regular expressions are only supported over a sequence of tokens.
- Returns:
- a ParseException
-
attemptToContinueWithIncompatibleParser
public static ParseException attemptToContinueWithIncompatibleParser()
Raised if an attempt is made to continue with an incompatible parser.- Returns:
- a ParseException
-
-