Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译parser.jjt出现异常 #5

Closed
flycash opened this issue May 15, 2016 · 3 comments
Closed

编译parser.jjt出现异常 #5

flycash opened this issue May 15, 2016 · 3 comments

Comments

@flycash
Copy link

flycash commented May 15, 2016

我对这个源码比较感兴趣,于是下载下来打算研究一下。在跑测试的时候发现找不到Parser这个类,后来看了一些博客之后,觉得是要先编译那个parser.jjt文件,是这样吗?
然后,我在编译的时候,出现了一个异常,以下是异常信息:
flycash@flycash-pc:~/git/mango$ javacc src/main/jjtree/parser.jjt
Java Compiler Compiler Version 5.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file src/main/jjtree/parser.jjt . . .
Warning: Line 10, Column 5: Bad option name "TRACK_TOKENS". Option setting will be ignored.
Warning: Line 13, Column 5: Bad option name "MULTI". Option setting will be ignored.
Warning: Line 16, Column 5: Bad option name "VISITOR". Option setting will be ignored.
org.javacc.parser.ParseException: Encountered " "#" "# "" at line 101, column 22.
Was expecting one of:
"throws" ...
":" ...

Detected 1 errors and 3 warnings.
不知道是哪里出了问题。PS:我还是第一次接触javacc这种东西,若是有什么学习资料,万望不吝指点。

@liangyanghe
Copy link
Member

hi,针对javacc的问题确实比较麻烦,有些maven版本支持自动生成源码,有些又不行。
针对此问题,我计划今天晚上将javacc生成的源码上传到src目录,这样就不再依赖maven中的javacc插件了,应该能解决你问题。
javacc是一个词法和语法的分析工具,学习他最好具备编译原理的知识,javacc的文档比较少,官网上有些例子,可以结合起来学习。

@liangyanghe
Copy link
Member

代码已提交,请更新到最新代码,再用IDE导入

@flycash
Copy link
Author

flycash commented May 16, 2016

好的,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants