资源简介
通过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个文件信息
相关资源
- Java写的cmm词法分析器源代码及javacc学
- Java写的递归下降分析程序
- 编译原理课程设计-java版
- 编译原理 C、Java语言词法分析器java实
- 广州大学编译原理实验报告1-3.zip
- 编译原理实验 词法分析设计 MFC
- 语义分析—编译原理
- javacc-5.0.rar
- java编写的算符优先分析法分析器
- 华中科技大学 编译原理 面向过程的
- 山东大学编译原理实验报告含代码
- Compiler_mean3tmp.rar
- 西安交通大学编译原理实验代码及报
- 编译原理第3版[刘铭][实验程序源代码
- 用Java做编译原理正规式转换成NFA.ra
- 编译原理课程设计含报告和可运行源
- 词法分析器实现java和c++
- 编译原理课程设计(附报告和可运行
- 现代编译原理虎书,包含c版和java版中
- 现代编译器的Java实现.(美)Andrew.W
- 编译原理java实现所需jar包-个人博客文
- 编译原理-虎书-龙书-鲸书
- java编写的LR语法分析器编译原理实验
- 基于MiniC的语义分析Javacc实现
- JAVA 编译原理 SLR(1)算法模拟器
- java 中间代码生成 编译原理
- 编译原理词法分析器 java版
- java 写的 用优先函数分析 数学表达式
- 符号串的最左和最右推导
- 编译原理词法分析器实现Java带界面源
评论
共有 条评论