[antlr-interest] Antlr 3.2 issues: code too large and "no such attribute: description"

Jim Idle jimi at temporal-wave.com
Tue Aug 17 16:13:44 PDT 2010


The JIRA you quote is not showing the same problems as the error you quote,
hence the patch is unlikely to help. If your grammar is too large with the
debug stuff in it then it is possible that its structure is not so good. It
is also possible that it is just too big for a single file of course. As you
say, you can debug at the java level too - the multiple grammar debugging
stuff in ANTLRWorks does not seem to be quite there.

Are you using the latest jar download to generate at the command line and
not the ANTLR that is embedded in ANTLRWorks? You should really supply the
invocations you are using as otherwise we have to guess. You could try
generating using the ANTLRWorks jar. However, if the code is too big with
debug stuff in it, then there isn't much you can do but start using imports.
Also, try increasing the conversion timeout.

Jim



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Edson Tirelli
> Sent: Tuesday, August 17, 2010 2:11 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Antlr 3.2 issues: code too large and "no such
> attribute: description"
> 
>    Hey all,
> 
>    Need some advice. Question:
> 
> * short version: Does anyone tried applying the patch from this ticket (
> http://www.antlr.org/jira/browse/ANTLR-378) on ANTLR 3.2? Is it still
good?
> 
> * long version:
> 
>    I am adding support for full Java expressions to Drools
(www.drools.org)
> DRL language, and basically my grammar (that was already complex) now is
> also twice the size it was. Before, I was using ANTLRWorks (1.4) to debug
my
> grammar but now, when I try to debug I get the error:
> 
> "code too large"
> 
>    That is a bit strange to me as the grammar generates just fine when I
use
> the command line tool to generate it, but I figured it might be due to
some
> additional code ANTLRWorks might be generating for debug purposes. My
> search through this list archives and internet found some comments stating
> that the way to go in this case would be to use Composite Grammars, but
the
> problem seems to be that neither antlrworks nor the eclipse plugin have
> proper support to it. I gave it a quick try and it does highlight missing
rules as
> errors in dependent grammars making maintenance a lot harder.
> 
>     So, if I would have to do remote debugging anyway, I tried to do it
with my
> current grammar. Although, when I try to generate the grammar with the "-
> debug" flag on the command line, I get:
> 
>     "[java] error(10):  internal error:
> src/main/resources/org/drools/lang/DRL.g :
> java.util.NoSuchElementException:
> no such attribute: description in template context [orPredicates
notPredicate
> evalPredicate(...)]"
> 
>     This is apparently a known bug reported since ANTLR 3.1.1 (
> http://www.antlr.org/jira/browse/ANTLR-378) for which a patch was
> provided but apparently never applied.
> 
>     Right now I am stuck, since I can not debug neither locally nor
remotely, I
> see only two options: either I go trial and error working on my grammar
> (what can be extremely time consuming for a complex grammar like
> ours) or I try to apply the patch and build my own StringTemplate/ANTLR
> binaries and hope that it will work.
> 
>     So, before spending more time on the later, I wanted to check if
anyone
> else tried that and succeeded, otherwise, I will just go the old way and
debug
> the generated code itself. :(
> 
>     Anyone worked around these problems yet? Any advice?
> 
>     Thanks a lot,
>        Edson
> 
> --
>   Edson Tirelli
>   JBoss Drools Core Development
>   JBoss by Red Hat @ www.jboss.com
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address



More information about the antlr-interest mailing list