CogPar
A versatile parser for mathematical expressions.
 All Classes Functions Variables
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
uk.co.cogitolearning.cogpar.ParserException Class Reference

A simple subclass of RuntimeException that indicates errors when trying to parse the input to Parser. More...

Collaboration diagram for uk.co.cogitolearning.cogpar.ParserException:
Collaboration graph
[legend]

Public Member Functions

 ParserException (String message)
 Construct the evaluation exception with a message.
 ParserException (String message, Token token)
 Construct the evaluation exception with a message and a token.
Token getToken ()
 Get the token.
String getMessage ()
 Overrides RuntimeException.getMessage to add the token information into the error message.

Private Attributes

Token token = null
 the token that caused the error

Static Private Attributes

static final long serialVersionUID = -1009747984332258423L

Detailed Description

A simple subclass of RuntimeException that indicates errors when trying to parse the input to Parser.

The exception stores the token that caused the error.

Definition at line 33 of file ParserException.java.

Constructor & Destructor Documentation

uk.co.cogitolearning.cogpar.ParserException.ParserException ( String  message)

Construct the evaluation exception with a message.

Parameters
messagethe message containing the cause of the exception

Definition at line 44 of file ParserException.java.

uk.co.cogitolearning.cogpar.ParserException.ParserException ( String  message,
Token  token 
)

Construct the evaluation exception with a message and a token.

Parameters
messagethe message containing the cause of the exception
tokenthe token that caused the exception

Definition at line 54 of file ParserException.java.

Member Function Documentation

String uk.co.cogitolearning.cogpar.ParserException.getMessage ( )

Overrides RuntimeException.getMessage to add the token information into the error message.

Returns
the error message

Definition at line 75 of file ParserException.java.

Token uk.co.cogitolearning.cogpar.ParserException.getToken ( )

Get the token.

Returns
the token that caused the exception

Definition at line 64 of file ParserException.java.


The documentation for this class was generated from the following file: