我正在使用ANTLRWorks 1.5,并试图编译和调试。有时,编译时会出现以下错误:
[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有人能告诉我这个错误是什么意思吗?
有时它编译时没有任何问题,但我总是在调试中得到‘超时值’错误。
我的代码是:
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();} ;发布于 2013-11-06 12:07:29
这意味着您需要更新到ANTLRWorks 1.5.2。
https://stackoverflow.com/questions/19810526
复制相似问题