[antlr-interest] Problems debugging large grammar in ANTLRWorks
Jim Idle
jimi at temporal-wave.com
Fri Jun 1 12:22:07 PDT 2007
I meant to add, that I personally get more mileage from just using
Visual Studio 2005 to debug the actual generated code - tends to give
you more of the information that C programmers are used to, even if you
don't get the 350Mb graphic display ;-)
Jim
> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of troy runkel
> Sent: Friday, June 01, 2007 11:32 AM
> To: ANTLR mail-list
> Subject: [antlr-interest] Problems debugging large grammar in
> ANTLRWorks
>
> 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