[antlr-interest] ANTLR 3.1: Decision analysis timeout seems too low

Kausch, Robert Robert.Kausch at ottogroup.com
Wed Aug 13 07:33:39 PDT 2008


That helped a lot! Thanks!

However, with conversiontimeout set to 1200000 ANTLR just used all the memory and then crashed. I now set it to 5000 which works fine for me.

Robert

-----Ursprüngliche Nachricht-----
Von: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] Im Auftrag von Mark Wright
Gesendet: Mittwoch, 13. August 2008 15:55
An: Kausch, Robert
Cc: antlr-interest at antlr.org
Betreff: Re: [antlr-interest] ANTLR 3.1: Decision analysis timeout seems too low


Hi,

You could try something like:

java -Xmx512m -classpath $(MY_CLASSPATH) org.antlr.Tool -Xconversiontimeout 1200000 -report mygrammar.g

on my grammar it only takes about 20 or 30 seconds for
antlr to generate the 2.8MB .java parser on a
dual 2.8GHz opteron box.  Which is great, antlr 3.1
is really fast.  It is normal to have to increase the
heap size and conversion timeout on large grammars.

Regards, Mark

On Wed, 13 Aug 2008 15:34:16 +0200
"Kausch, Robert" <Robert.Kausch at ottogroup.com> wrote:

> Hi,
>
> I'm working on an ANTLR grammar for ABAP which, due to the size of 
> that language, is steadily becoming really huge.
>
> Now I reached a point where ANTLR sometimes gives me the following 
> error message while processing the parser grammar:
>
> error(10):  internal error:
> org.antlr.tool.Grammar.createLookaheadDFA(Grammar.java:1228): could 
> not even do k=1 for decision 103; reason: timed out (>1000ms)
>
> I can trigger this error by taking away CPU time from ANTLR while it 
> is processing the parser grammar (e.g. by browsing the web, starting a 
> program etc.). If I just sit still and do nothing during the ANTLR 
> run, it processes everything just fine. However, adding one more rule 
> to my grammar triggers the error all the time.
>
> I figure increasing the value for MAX_TIME_PER_DFA_CREATION in 
> DFA.java would solve the problem. But maybe it would be better to add 
> a command line option for setting the timeout value.
>
> I tried setting the timeout to 5000, but that caused the same problem 
> followed by a Java heap space out of memory error. A value of 2000 
> finally worked for me.
>
> Greetings,
> Robert
>


--


More information about the antlr-interest mailing list