Class ParseFailureException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.aquima.interactions.foundation.exception.AppException
-
- com.aquima.interactions.expressions.ParseException
-
- com.aquima.interactions.expressions.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 Summary
Constructors Constructor Description ParseFailureException​(int symbol, Position position, Object token)
Construct a parse failure exception at the specified character position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getOffset()
Returns the character position.Position
getPosition()
Returns the position object information for the current error.int
getSymbol()
This function returns the symbol id for the parse error, this symbol can be found in the symtable of the corresponding parser.Object
getToken()
This method returns the token for which the exception occurred.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
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.
-
-