开发者

problem antlrworks code too large

开发者 https://www.devze.com 2022-12-24 19:21 出处:网络
In Antlrworks I get this error: [18:21:03] Checking Grammar Grammar.g... [18:21:26] Grammar.java:12: 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

精彩评论

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

关注公众号