Class 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 Detail

      • ParseException

        public ParseException​(java.lang.String code,
                              java.lang.String message)
        An parse exception with a message.
        Parameters:
        code - the code
        message - 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 code
        message - the message
        cause - 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