com.agentfactory.common.parser
Class SemanticError
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.agentfactory.common.parser.SemanticError
- All Implemented Interfaces:
- java.io.Serializable
public class SemanticError
- extends java.lang.Exception
This exception is thrown whenever one of the visitors detects a semantic
error in the source code of the program. Semantic errors are errors that
arise within syntactically correct code (e.g. a repeated activity identifier).
It is designed to generate an error message that complies with the Java
error reporting format.
Current errors consist of:
- a general error message
- contextual information about the cause of the error message
- a token close to the error.
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 |
SemanticError(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 |
SemanticError
public SemanticError(java.lang.String error,
java.lang.String cause,
Token token)
- Creates a new Syntax Error.
- Parameters:
error - the general class of errorcause - some context that provides information about the actual
cause of the errortoken - a token close to the error that can be used to report
the location of the error.
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