com.agentfactory.common.parser
Class SyntaxError

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.agentfactory.common.parser.SyntaxError
All Implemented Interfaces:
java.io.Serializable

public class SyntaxError
extends java.lang.Exception

This exception is thrown whenever one of the handlers detects a syntax error in the source code of the program. It is designed to generate an error message that complies with the Java error reporting format. Current errors consist of:

TODO (Rem Collier): Really the token is now only used to retrieve the line number on which the syntax error occurred. A possible change to this class is to store only the line number, and not the full token.

See Also:
Serialized Form

Constructor Summary
SyntaxError(java.lang.String error, java.lang.String cause, Token token)
          Creates a new Syntax Error.
 
Method Summary
 java.lang.String getMessage()
          Accessor that returns the message in java error format.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SyntaxError

public SyntaxError(java.lang.String error,
                   java.lang.String cause,
                   Token token)
Creates a new Syntax Error.

Parameters:
error - the general class of error
cause - some context that provides information about the actual cause of the error
token - a token close to the error that can be used to report the location of the error.
Method Detail

getMessage

public java.lang.String getMessage()
Accessor that returns the message in java error format.

Overrides:
getMessage in class java.lang.Throwable
Returns:
the syntax error message