[antlr-interest] Problems debugging large grammar in ANTLRWorks

troy runkel trunkel at gmail.com
Fri Jun 1 11:32:13 PDT 2007


Greetings,

I'm working with a fairly large grammar (1620 lines) and was hoping to
debug it using ANTLRWorks 1.0.1.  When I select the 'Debug...' option
from the Debugger menu I get the following error message popup.  My
grammar is using the language=C option.

     Error while generating the grammar:
     (10): internal error: group CDbg line 33: template outputFile has
no region called imports

This looks like a problem with the C code generator so I commented out
the language=C option line and tried again.  After that I get the
following error message in the Console window.

     [12:22:02] \tmp\antlrworks\TSQLParser.java:20: code too large
     [12:22:02]     public static final String[] tokenNames = new String[] {
     [12:22:02]                                  ^
     [12:22:02] 1 error

It looks like maybe there are too many token strings in the tokenNames
array?  Does anybody have any advice on what I need to do to get my
grammar working with the ANTLRWorks debugger?

I also noticed that after processing the grammar ANTLRWorks is
consuming over 900MB of memory on my Windows XP desktop machine.  If I
avoid ANTLRWorks and process the grammar directly with ANTLR I get up
to around 600MB of memory.  Is this normal?  Does that mean there's an
upper bound to the size of the grammar that ANTLR can process?  I've
been running java with the -Xmx1490m option to avoid running out of
java heap space.

In addition to the language=C option I'm also using backtrack=true and
memoize=true.

Thanks.

Troy Runkel


More information about the antlr-interest mailing list