public class TokenMgrError extends Error
Constructor and Description |
---|
TokenMgrError()
No arg constructor.
|
TokenMgrError(boolean eof,
int state,
int line,
int col,
String after,
char curr,
int reason)
Full Constructor.
|
TokenMgrError(String message,
int reason)
Constructor with message and reason.
|
Modifier and Type | Method and Description |
---|---|
protected static String |
addEscapes(String str)
Replaces unprintable characters by their escaped (or unicode escaped)
equivalents in the given string.
|
String |
getMessage()
You can also modify the body of this method to customize your error messages.
|
protected static String |
lexicalError(boolean eof,
int state,
int line,
int col,
String after,
char curr)
Returns a detailed message for the Error when it is thrown by the
token manager to indicate a lexical error.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public TokenMgrError()
public TokenMgrError(String message, int reason)
message
- error messagereason
- one of LEXICAL_ERROR
, INVALID_LEXICAL_STATE
,
STATIC_LEXER_ERROR
, LOOP_DETECTED
public TokenMgrError(boolean eof, int state, int line, int col, String after, char curr, int reason)
eof
- end of file seen?state
- lexer stateline
- error linecol
- error columnafter
- string after which the error occuredcurr
- current characterreason
- one of LEXICAL_ERROR
, INVALID_LEXICAL_STATE
,
STATIC_LEXER_ERROR
, LOOP_DETECTED
protected static String addEscapes(String str)
str
- string to be escapedprotected static String lexicalError(boolean eof, int state, int line, int col, String after, char curr)
eof
- indicates if EOF caused the lexical errorstate
- lexical state in which this error occurredline
- line number when the error occurredcol
- column number when the error occurredafter
- prefix that was seen before this error occurredcurr
- the offending characterpublic String getMessage()
getMessage
in class Throwable
Copyright © 2005–2023 BaseX Team. All rights reserved.