资源简介
通过javacc来设计一个小型编译器,思路清晰,功能完善
代码片段和文件信息
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 4.1 */
/* JavaCCOptions:KEEP_LINE_COL=null */
package hao.pakg;
/**
* This exception is thrown when parse errors are encountered.
* You can explicitly create objects of this exception type by
* calling the method generateParseException in the generated
* parser.
*
* You can modify this class to customize your error reporting
* mechanisms so long as you retain the public fields.
*/
public class ParseException extends Exception {
/**
* This constructor is used by the method “generateParseException“
* in the generated parser. Calling this constructor generates
* a new object of this type with the fields “currentToken“
* “expectedTokenSequences“ and “tokenImage“ set. The boolean
* flag “specialConstructor“ is also set to true to indicate that
* this constructor was used to create this object.
* This constructor calls its super class with the empty string
* to force the “toString“ method of parent class “Throwable“ to
* print the error message in the form:
* ParseException:
*/
public ParseException(Token currentTokenVal
int[][] expectedTokenSequencesVal
String[] tokenImageVal
)
{
super(““);
specialConstructor = true;
currentToken = currentTokenVal;
expectedTokenSequences = expectedTokenSequencesVal;
tokenImage = tokenImageVal;
}
/**
* The following constructors are for use by you for whatever
* purpose you can think of. Constructing the exception in this
* manner makes the exception behave in the normal way - i.e. as
* documented in the class “Throwable“. The fields “errorToken“
* “expectedTokenSequences“ and “tokenImage“ do not contain
* relevant information. The JavaCC generated code does not use
* these constructors.
*/
public ParseException() {
super();
specialConstructor = false;
}
/** Constructor with message. */
public ParseException(String message) {
super(message);
specialConstructor = false;
}
/**
* This variable determines which constructor was used to create
* this object and thereby affects the semantics of the
* “getMessage“ method (see below).
*/
protected boolean specialConstructor;
/**
* This is the last token that has been consumed successfully. If
* this object has been created due to a parse error the token
* followng this token will (therefore) be the first error token.
*/
public Token currentToken;
/**
* Each entry in this array is an array of integers. Each array
* of integers represents a sequence of tokens (by their ordinal
* values) that is expected at this point of the parse.
*/
public int[][] expectedTokenSequences;
/**
* This is a reference to the “tokenImage“ array of the gener
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-01-20 21:47 代码\
目录 0 2013-01-20 21:47 代码\complier\
文件 1969 2013-01-18 14:18 代码\complier\.classpath
文件 567 2013-01-18 08:35 代码\complier\.project
目录 0 2013-01-20 21:47 代码\complier\.settings\
文件 629 2013-01-18 08:35 代码\complier\.settings\org.eclipse.jdt.core.prefs
文件 220 2013-01-18 08:35 代码\complier\.settings\sf.eclipse.javacc.prefs
目录 0 2013-01-20 21:47 代码\complier\bin\
目录 0 2013-01-20 21:47 代码\complier\bin\hao\
目录 0 2013-01-20 21:47 代码\complier\bin\hao\pakg\
文件 11192 2013-01-18 08:35 代码\complier\bin\hao\pakg\new_file.jj
文件 3572 2013-01-18 14:27 代码\complier\bin\hao\pakg\ParseException.class
文件 15457 2013-01-18 14:28 代码\complier\bin\hao\pakg\Parser.class
文件 3762 2013-01-18 14:27 代码\complier\bin\hao\pakg\ParserConstants.class
文件 15476 2013-01-18 14:27 代码\complier\bin\hao\pakg\ParserTokenManager.class
文件 8107 2013-01-18 14:27 代码\complier\bin\hao\pakg\SimpleCharStream.class
文件 1097 2013-01-18 14:27 代码\complier\bin\hao\pakg\Token.class
文件 2775 2013-01-18 14:27 代码\complier\bin\hao\pakg\TokenMgrError.class
文件 901 2013-01-18 14:27 代码\complier\bin\hao\pakg\Windows$1.class
文件 1651 2013-01-18 14:27 代码\complier\bin\hao\pakg\Windows$2.class
文件 3598 2013-01-18 14:27 代码\complier\bin\hao\pakg\Windows.class
文件 740 2013-01-18 09:53 代码\complier\for_test(郝宁).txt
目录 0 2013-01-20 21:47 代码\complier\src\
目录 0 2013-01-20 21:47 代码\complier\src\hao\
目录 0 2013-01-20 21:47 代码\complier\src\hao\pakg\
文件 11192 2013-01-18 08:35 代码\complier\src\hao\pakg\new_file.jj
文件 6864 2013-01-18 14:27 代码\complier\src\hao\pakg\ParseException.java
文件 24486 2013-01-18 14:28 代码\complier\src\hao\pakg\Parser.java
文件 4716 2013-01-18 14:27 代码\complier\src\hao\pakg\ParserConstants.java
文件 33219 2013-01-18 14:27 代码\complier\src\hao\pakg\ParserTokenManager.java
文件 13057 2013-01-18 14:27 代码\complier\src\hao\pakg\SimpleCharStream.java
............此处省略4个文件信息
相关资源
- 云南大学编译原理实验1-4-6
- 编译原理第二版 龙书
- 清华大学编译课decaf编译器源码
- 用编译原理知识编写的计算器
- 编译原理 电梯模拟程序java版
- JAVA写的编译器编译原理课设
- 一个java实现的简易编译器
- 简单函数绘图语言java
- 编译原理 王生原等编
- 编译原理中的first集合follow集的求解
- Compiler_mean3.rar
- 目标代码生成 java版
- 编译原理词法分析源码语法分析源码
- JavaCC语法分析器 基于Eclipse插件 能从
- 赋值语句的翻译程序 编译原理 Java
- java 实现的词法分析器
- 编译原理 语法分析
- PL/0语言编译器源程序山东大学编译原
- 编译原理--预测分析法 java
- 编译原理-简单计算器的设计1
- javacc 词法分析解释器
- javaCC5.0压缩包
- SeuLex SeuYacc编译原理课程设计,Java实
- 编译原理 first follow java版
- 编译原理课程设计 符号串的最左推导
- 编译原理实验三-递归下降分析程序
- 使用Javacc做的解释器超详细
- 使用javacc实现基于miniC的语法分析器完
- JAVA版编译原理大作业之可编程计算器
- 编译原理--LR1分析表构造JAVA.rar
评论
共有 条评论