为什么我的ANTLR构建Ant任务失败,"无法确定生成的类"? [英] Why does my ANTLR build Ant task fail with "Unable to determine generated class"?

查看:287
本文介绍了为什么我的ANTLR构建Ant任务失败,"无法确定生成的类"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用<一个href=\"http://www.antlr.org/wiki/display/ANTLR3/How+to+use+ant+with+ANTLR3#HowtouseantwithANTLR3-ANTLR3taskforant\"相对=nofollow> ANTLR3任务蚂蚁,但我得到一个无法确定生成的类建设失败的消息。

I'm trying to use ANTLR3 task for Ant, but I get an "Unable to determine generated class" build failure message.

一个快速的研究显示,很多人都有过同样的问题,没有解决方案所提供(见下面的链接)。

A quick research shows that many people have had the same problem, with no solution provided (see links below).

有人建议可以不诉诸使用常规的Java Ant任务的解决方案?

Can someone suggest a solution that doesn't resort to using a regular Java Ant task?

外部链接:

  • http://www.antlr.org/pipermail/antlr-interest/2009-November/036795.html
  • http://www.antlr.org/pipermail/antlr-interest/2006-July/016870.html
  • http://palove.kadeco.sk/itblog/posts/40

推荐答案

ANTLR 的任务包括用Ant 1.8.2(最新版本)似乎是依赖于ANTLR 2.7.2(在 $ ANT_HOME定义的/ lib目录/ ANT-antlr.pom ,并使用 $ ANT_HOME / lib目录/ ANT-antlr.jar

The antlr task included with Ant 1.8.2 (the latest version) seems to be dependent on ANTLR 2.7.2 (defined in $ANT_HOME/lib/ant-antlr.pom and using $ANT_HOME/lib/ant-antlr.jar.

什么任务做的是扫描目标文件的线路匹配 ^类(。*)延伸。* ,其中第一个比赛组将被用作命名生成的文件的。这整个语法位似乎在ANTLR 3.x中被丢弃,或者至少成为可选,因为我能够生成解析器不使用常规的Java任务工作围绕你提到它。

What the task is doing is scanning the target file for a line matching ^class (.*) extends .*, where the first match group will be used as the name of the generated file. This whole bit of syntax seems to have been dropped in ANTLR 3.x, or at least made optional, because I'm able to generate parsers without it using the regular java task work-around you mentioned.

http://antlr.org/ 的文件共享标题下的头版是一个链接来 ANTLR V3为Ant任务的,但遗憾的是它并没有出现被诸如此类的直接替代我所期待的。事实上,它似乎很我坚持用纯java任务是颇为曲折。

On the front page of http://antlr.org/ under the "File Sharing" heading is a link to ANTLR v3 task for Ant, but unfortunately it doesn't appear to be the sort of drop-in replacement I was hoping for. Actually, it seems to be rather convoluted so I've stuck with using the plain java task.

这篇关于为什么我的ANTLR构建Ant任务失败,&QUOT;无法确定生成的类&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆