Class ParseFailureException

  • All Implemented Interfaces:
    Serializable

    public class ParseFailureException
    extends ParseException
    This exception is thrown when the syntactic analysis failed.
    Since:
    6.0
    Author:
    F. van der Meer
    See Also:
    Serialized Form
    • Constructor Detail

      • ParseFailureException

        public ParseFailureException​(int symbol,
                                     Position position,
                                     Object token)
        Construct a parse failure exception at the specified character position. Optionally the token which caused the error can be passed as well.
        Parameters:
        symbol - The symbol at which the parse error occurred.
        position - The character position of the expression where the exception occurred ( not byte position )
        token - The token which caused the failure.
    • Method Detail

      • getSymbol

        public int getSymbol()
        This function returns the symbol id for the parse error, this symbol can be found in the symtable of the corresponding parser.
        Returns:
        The symbol for the corresponding parser.
      • getOffset

        public int getOffset()
        Returns the character position.
        Returns:
        The character position which designates the failure position.
      • getPosition

        public Position getPosition()
        Returns the position object information for the current error.
        Returns:
        A position object.
      • getToken

        public Object getToken()
        This method returns the token for which the exception occurred.
        Returns:
        The object token which can be null when it was not known.