views:

88

answers:

1

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 final 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.

+1  A: 

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".

Bart Kiers