开发者

problem antlrworks code too large

In Antlrworks I get this error:

 [18:21:03] Checking Grammar Grammar.g...
 [18:21:26] Grammar.java:12: code too large
 [18:21:26]     public static fi开发者_JAVA百科nal String[] tokenNames = new String[] {
 [18:21:26]                                  ^
 [18:21:26] 1 error

Using instead the generated code in a Java project works normally. What can be had this problem?

Thanks.


For larger grammars, it's easier to split your grammar into bite-sized chunks (at least a separate lexer and parser). If you do so, ANTLRWorks will probably stop complaining as well.

Checkout the Wiki entry about "Composite grammars".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜