|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
marf.util.MARFException
marf.nlp.NLPException
marf.nlp.Parsing.CompilerError
marf.nlp.Parsing.SemanticError
public class SemanticError
Class SemanticError Represents an instance of a semantic error in the semantic analysis process.
$Id: SemanticError.java,v 1.16 2007/12/18 21:37:55 mokhov Exp $
| Field Summary | |
|---|---|
static int |
ERR_ASSIGN_TYPE_MISMATCH
Type mismatch in the assignment. |
static int |
ERR_CUSTOM
Custom error message as alternative to 'unknown'. |
static int |
ERR_EXPR_TYPE_MISMATCH
Type mismatch in an expression. |
static int |
ERR_MULT_DEF_SYM
Symbol defined multiple times. |
static int |
ERR_PARAM_TYPE_MISMATCH
Mismatch of types of parameters in a function call. |
static int |
ERR_UNDEF_SYM
Undefined Symbol. |
protected Token |
oFaultingToken
Token information at which Lexer encountered the error. |
| Fields inherited from class marf.nlp.Parsing.CompilerError |
|---|
iCurrentErrorCode, iLineNo, OK |
| Fields inherited from class marf.util.MARFException |
|---|
strMessage |
| Constructor Summary | |
|---|---|
SemanticError()
Default constructor. |
|
SemanticError(java.lang.Exception poException)
Wraps an exception. |
|
SemanticError(int piErrorCode,
Token poFaultingToken)
Constructor with an error code and a faulting token. |
|
SemanticError(java.lang.String pstrMessage)
Construct just given the error message |
|
SemanticError(java.lang.String pstrMessage,
java.lang.Exception poException)
Wraps an exception with a custom error message |
|
SemanticError(Token poFaultingToken,
java.lang.String pstrCustomErrorMessage)
Constructor alternative to Unknown error with the custom error message. |
|
| Method Summary | |
|---|---|
static java.lang.String |
getMARFSourceCodeRevision()
Returns source code revision information. |
boolean |
serialize(int piOperation,
java.io.FileWriter poFileWriter)
Serialization routine. |
| Methods inherited from class marf.nlp.Parsing.CompilerError |
|---|
getCurrentErrorCode, getLineNo |
| Methods inherited from class marf.util.MARFException |
|---|
create, create, create, create, getMessage, toString |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ERR_UNDEF_SYM
public static final int ERR_MULT_DEF_SYM
public static final int ERR_EXPR_TYPE_MISMATCH
public static final int ERR_ASSIGN_TYPE_MISMATCH
public static final int ERR_PARAM_TYPE_MISMATCH
public static final int ERR_CUSTOM
protected Token oFaultingToken
| Constructor Detail |
|---|
public SemanticError(int piErrorCode,
Token poFaultingToken)
piErrorCode - one of the defined error codespoFaultingToken - the semantic token that caused the error.
public SemanticError(Token poFaultingToken,
java.lang.String pstrCustomErrorMessage)
poFaultingToken - the semantic token that caused the error.pstrCustomErrorMessage - custom error messagepublic SemanticError()
public SemanticError(java.lang.Exception poException)
poException - exception to wrappublic SemanticError(java.lang.String pstrMessage)
pstrMessage - custom error message
public SemanticError(java.lang.String pstrMessage,
java.lang.Exception poException)
pstrMessage - custom error messagepoException - exception to wrap| Method Detail |
|---|
public boolean serialize(int piOperation,
java.io.FileWriter poFileWriter)
piOperation - 0 means load (not implemented) and 1 means savepoFileWriter - writer object to write the error message to
true if the operation was successfulpublic static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||