Why does Antlr not generate a lexer java file?

时间秒杀一切 提交于 2019-12-12 03:09:28

问题


Antlr3 does not generate Mylexer.java. I use AntlrWorks...

when I have grammar starting like

grammar mylexer;

It does generate myParser.java

It looks like a simple thing.. I wonder what may be the reason.. and the solution... I get no error message.


回答1:


I found a way. AntlrWorks 1.4 seems to have a bug. When I pressed ctrl+shift+G to generate it did not give an error message (in fact, I got that compilation was ok) and generated a parser file only. The cursor was not on the first line of the source file when that happened.

WHen I pressed ctrl+shift+G in the first line, I got an error message and when I fixed those, a lexer file was generated too.



来源:https://stackoverflow.com/questions/2930105/why-does-antlr-not-generate-a-lexer-java-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!