最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Eclipse中对于antlr去Debug(Java)时出错:execution was cancelled reason code generation fails

ANTLR crifan 2474浏览 0评论

【问题】

折腾:

【记录】使用Eclipse开发Antlr:如何调试antlr项目

的过程中,对于antlr项目,在Interpreter中,去Debug(Java)时,出错:

execution was cancelled reason code generation fails

ANTLR Parser Generator Version 3.3 Nov 30, 2010 12:50:56
D:\DevRoot\android\android_root\HartEddl\HartEddl.g
error(10): internal error: Exception D:\DevRoot\android\android_root\HartEddl\HartEddl.g:108:9: expecting ‘*’, found ‘8’@org.antlr.grammar.v2.ANTLRLexer.nextToken(ANTLRLexer.java:346): unexpected stream error from parsing D:\DevRoot\android\android_root\HartEddl\HartEddl.g

error(150): grammar file D:\DevRoot\android\android_root\HartEddl\HartEddl.g has no rules
error(100): D:\DevRoot\android\android_root\HartEddl\HartEddl.g:0:0: syntax error: assign.types: <AST>:0:0: unexpected end of subtree
error(100): D:\DevRoot\android\android_root\HartEddl\HartEddl.g:0:0: syntax error: define: <AST>:0:0: unexpected end of subtree

【解决过程】

1.换成3.5:

change to 3.5 complet antlr jar

refresh后,重新编译试试,然后就解决了问题了。

重新Build Project后,就可以正常编译了。

console中,就没有错误了。

 

【总结】

针对对应的所引用的antrl的jar的话,还是要使用合适当前项目的,

此处最新的是antlr-3.5-complete.jar,去编译antlr代码,就是正常的了。

转载请注明:在路上 » 【已解决】Eclipse中对于antlr去Debug(Java)时出错:execution was cancelled reason code generation fails

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.164 seconds, using 22.10MB memory