首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ANTLRWorks编译

ANTLRWorks编译
EN

Stack Overflow用户
提问于 2013-11-06 11:10:55
回答 1查看 231关注 0票数 0

我正在使用ANTLRWorks 1.5,并试图编译和调试。有时,编译时会出现以下错误:

代码语言:javascript
复制
[11:44:52] TODO: run and send output to this console
[11:44:56] C:\Antlr\output\tryParser.java:102: error: <identifier> expected
[11:44:56]  public final tryParser.poly_return poly() throws  {
[11:44:56]                                                  ^
[11:44:56] C:\Antlr\output\tryParser.java:215: error: <identifier> expected
[11:44:56]  public final tryParser.term_return term() throws  {
[11:44:56]                                                  ^
[11:44:56] C:\Antlr\output\tryParser.java:504: error: <identifier> expected
[11:44:56]  public final tryParser.exp_return exp() throws  {
[11:44:56]                                                ^
[11:44:56] 3 errors

有人能告诉我这个错误是什么意思吗?

有时它编译时没有任何问题,但我总是在调试中得到‘超时值’错误。

我的代码是:

代码语言:javascript
复制
grammar try;
options {output=AST;}
tokens { MULT; } // imaginary token

poly: term ('+'^ term)*
;

term: INT ID  -> ^(MULT["*"] INT ID)
| INT exp -> ^(MULT["*"] INT exp)
| exp
| INT
| ID
;
exp : ID '^'^ INT
;

ID  : 'a'..'z'+ ;
INT : '0'..'9'+ ;
WS  : (' '|'\t'|'\r'|'\n')+ {skip();} ;
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-06 12:07:29

这意味着您需要更新到ANTLRWorks 1.5.2。

问题5: ANTLRworks无法生成正确的Java代码

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19810526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档