Package net.sourceforge.pmd.lang.ast
Class TokenMgrError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- net.sourceforge.pmd.lang.ast.TokenMgrError
-
- All Implemented Interfaces:
Serializable
public final class TokenMgrError extends RuntimeException
An error thrown during lexical analysis of a file.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intINVALID_LEXICAL_STATEDeprecated.static intLEXICAL_ERRORDeprecated.static intLOOP_DETECTEDDeprecated.static intSTATIC_LEXER_ERRORDeprecated.
-
Constructor Summary
Constructors Constructor Description TokenMgrError()Deprecated.TokenMgrError(boolean eofSeen, int lexStateName, int errorLine, int errorColumn, String errorAfter, char curChar, int reason)Deprecated.This should only be used by the Javacc implementations we maintain, will change in 7.0TokenMgrError(int line, int column, String filename, String message, Throwable cause)Create a new exception.TokenMgrError(String message, int reason)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static StringaddEscapes(String str)Deprecated.intgetColumn()StringgetFilename()intgetLine()StringgetMessage()protected static StringLexicalError(boolean eofSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar)Deprecated.TokenMgrErrorwithFileName(String filename)Replace the file name of this error.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
LEXICAL_ERROR
@Deprecated public static final int LEXICAL_ERROR
Deprecated.- See Also:
- Constant Field Values
-
STATIC_LEXER_ERROR
@Deprecated public static final int STATIC_LEXER_ERROR
Deprecated.- See Also:
- Constant Field Values
-
INVALID_LEXICAL_STATE
@Deprecated public static final int INVALID_LEXICAL_STATE
Deprecated.- See Also:
- Constant Field Values
-
LOOP_DETECTED
@Deprecated public static final int LOOP_DETECTED
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TokenMgrError
@Deprecated public TokenMgrError()
Deprecated.
-
TokenMgrError
@Deprecated public TokenMgrError(String message, int reason)
Deprecated.
-
TokenMgrError
public TokenMgrError(int line, int column, String filename, String message, Throwable cause)Create a new exception.- Parameters:
line- Line numbercolumn- Column numberfilename- Filename. If unknown, it can be completed withwithFileName(String)latermessage- Message of the errorcause- Cause of the error, if any
-
TokenMgrError
@InternalApi @Deprecated public TokenMgrError(boolean eofSeen, int lexStateName, int errorLine, int errorColumn, String errorAfter, char curChar, int reason)
Deprecated.This should only be used by the Javacc implementations we maintain, will change in 7.0Constructor called by JavaCC.
-
-
Method Detail
-
getLine
public int getLine()
-
getColumn
public int getColumn()
-
getFilename
public String getFilename()
-
addEscapes
@Deprecated protected static String addEscapes(String str)
Deprecated.
-
LexicalError
@Deprecated protected static String LexicalError(boolean eofSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar)
Deprecated.
-
getMessage
public String getMessage()
- Overrides:
getMessagein classThrowable
-
withFileName
public TokenMgrError withFileName(String filename)
Replace the file name of this error.- Parameters:
filename- New filename- Returns:
- A new exception
-
-