BB.
BB.

Reputation: 113

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

Upvotes: 2

Views: 551

Answers (1)

Bart Kiers
Bart Kiers

Reputation: 170178

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

Upvotes: 2

Related Questions