Eclipse中Antlr安装问题
我在 Eclipse 中安装了 Antlr。并将antlr-code生成器-输出文件夹-项目相对文件夹设置为antlr-generator。
我可以新建语法文件(grammar.g)并成功编译它。 文件夹(antlr-generator)中没有文件 但文件: GrammarLexer.java 和 GrammarParser.java 未创建。
如何解决这个问题?
I install antlr in my eclipse. And set antlr-code generator-output folder-project relative folder as antlr-generator.
I can new grammar file (grammar.g)and compile it successfully.
There isn't files in the folder (antlr-generator)
But files:
grammarLexer.java and grammarParser.java are not created.
How can fix this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚在 Windows 7x64 上安装了 Eclipse Indigo 和 ANTLR 3.4,遇到了同样的问题,并且 ANTLR 控制台上没有错误。卸载了java并安装了最新的v7更新4(32位和64位)并清理了类路径和路径环境变量。仍然没有生成文件,但现在我在 ANTLR 控制台中看到错误“没有这样的目录:org/antlr/tool/templates/dot/dfa”。该修复位于 Eclipse 中的 Window、Preferences、ANTLR、Builder、Building 下。在“常规”部分中,确保 -nfa 和 -dfa 未选中。这为我解决了这个问题。
我不是一个专业的程序员,还没有编写过 ANTLR 程序。也许这里的其他人可以弄清楚如何修复找不到目录的错误。
我最终创建了这篇关于配置 ANTLR IDE 的文章以防万一您从未进行过此工作或只是想检查您的配置。 这篇关于测试/调试的文章也可能会有所帮助。
Just installed Eclipse Indigo and ANTLR 3.4 on Windows 7x64 and had the same problem and no errors on the ANTLR Console. Uninstalled java and installed latest v7 update 4 (32 and 64 bit) and cleaned up classpath and path environment variables. Still no files generated but now I was seeing error "No such directory: org/antlr/tool/templates/dot/dfa" in the ANTLR Console. The fix is in Eclipse under Window, Preferences, ANTLR, Builder, Building. In the General section, make sure that -nfa and -dfa are unchecked. This fixed it for me.
I am not an expert programmer and have yet to write an ANTLR program. Probably others here can figure out how to fix the directory not found error.
I ended up creating this article on configuring ANTLR IDE in case you never go this working or just wanted to check your configuration. And this article on testing/debugging may be helpful also.