|
||||||||||
| 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.LexicalError
public class LexicalError
This class denotes a lexical error type.
$Id: LexicalError.java,v 1.20 2008/01/03 03:21:57 mokhov Exp $
| Field Summary | |
|---|---|
static int |
ERR_BAD_REAL
Badly formed real number. |
static int |
ERR_CUSTOM
Custom error message as alternative to 'unknown'. |
static int |
ERR_EXTRA_CLOSING_COMMENT
Mismatched comment. |
static int |
ERR_INVALID_CHAR
Character encountered is not part of the MARF's alphabet. |
static int |
ERR_INVALID_NUMBER_FORMAT
Invalid number format. |
static int |
ERR_LEADING_ZEROS
Leading zeros are not allowed in numbers. |
static int |
ERR_TRAILING_ZEROS
Not meaningful trailing zeros aren't allowed. |
static int |
ERR_UNEXPECTED_EOF
Unexpected EOF and no ending comment. |
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 | |
|---|---|
LexicalError()
Constructs default generic lexical error. |
|
LexicalError(java.lang.Exception poException)
Constructs a lexical error with wrapped exception. |
|
LexicalError(int piErrorCode,
Token poFaultingToken)
Constructor with an error code and a faulting token. |
|
LexicalError(java.lang.String pstrMessage)
Constructs a lexical error with a custom error message string. |
|
LexicalError(java.lang.String pstrMessage,
java.lang.Exception poException)
Constructs a lexical error with wrapped exception and a custom error message string. |
|
LexicalError(Token poFaultingToken,
java.lang.String pstrCustomErrorMessage)
Constructor alternative to Unknown error given token and a custom message. |
|
| Method Summary | |
|---|---|
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
boolean |
serialize(int piOperation,
java.io.FileWriter poWriter)
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_INVALID_CHAR
public static final int ERR_LEADING_ZEROS
public static final int ERR_TRAILING_ZEROS
public static final int ERR_BAD_REAL
public static final int ERR_INVALID_NUMBER_FORMAT
public static final int ERR_UNEXPECTED_EOF
public static final int ERR_EXTRA_CLOSING_COMMENT
public static final int ERR_CUSTOM
protected Token oFaultingToken
| Constructor Detail |
|---|
public LexicalError(int piErrorCode,
Token poFaultingToken)
piErrorCode - the error code to indicate the messagepoFaultingToken - the token that caused the error
public LexicalError(Token poFaultingToken,
java.lang.String pstrCustomErrorMessage)
poFaultingToken - the token that caused the errorpstrCustomErrorMessage - custom error message stringpublic LexicalError()
public LexicalError(java.lang.Exception poException)
poException - the wrapped exceptionpublic LexicalError(java.lang.String pstrMessage)
pstrMessage - the custom error message
public LexicalError(java.lang.String pstrMessage,
java.lang.Exception poException)
pstrMessage - the custom error messagepoException - the wrapped exception| Method Detail |
|---|
public boolean serialize(int piOperation,
java.io.FileWriter poWriter)
piOperation - 0 for load and 1 for savepoWriter - writer object to use to write to
true if serialization was successfulpublic static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||