📄 parserexception.java
字号:
/**
* This exception is generated for general errors during parsing, for instance,
* if the anticipated token isn't there. Inherit from this exception to create
* more specific and detailed error types. Use InterpreterException to show
* problems during interpretation.
*
* @see InterpreterException
* @see ScannerException
*/
public class ParserException extends Exception {
private int pos;
private int line;
private String text;
/**
* Instantiates a ParserException.
*
* @param l
* The line where the error was found.
* @param p
* The column where the error was found.
* @param t
* an error description
*/
ParserException(int l, int p, String t) {
super("ParserException <" + t + "> at line " + l + " and position " + p
+ ".");
line = l;
pos = p;
text = t;
}
/**
* Returns the line where the error was found.
*
* @return the error line.
*/
int line() {
return line;
}
/**
* Returns the column where the error was found.
*
* @return the error column.
*/
int pos() {
return pos;
}
/**
* Returns the error description.
*
* @return the error description
*/
String text() {
return text;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -