[JavaCC]: javacc seems to infinitely loop

View: New views
2 Messages — Rating Filter:   Alert me  

[JavaCC]: javacc seems to infinitely loop

by Giacomo Galilei :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Probably a bug in your grammar, I'd guess.  You grammar is probably 
> causing Javacc to loop.
>
> DR

I guess too.
I tried to port the JML grammar which is available at http://www.eecs.ucf.edu/~leavens/JML/jmlrefman/jmlrefman_21.html#SEC219 into JavaCC. Unfortunately the grammar is not error free and presents some defect that I tried to manually solve (probably I've missed some of them).

> What is the grammer.? Can u please post it.?
>
> Nadun
The grammar is quite long. I pasted it at http://pastebin.com/m7f5f655f
Before inserting the section 9 the generation went fine. The rule statement() is one of the last I added, and I notice that commenting it out makes the problem disappear

Gg

Re: [JavaCC]: javacc seems to infinitely loop

by Paul Cager-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 2009-07-20 at 17:45 +0200, Giacomo Galilei wrote:
> The grammar is quite long. I pasted it at
> http://pastebin.com/m7f5f655f
> Before inserting the section 9 the generation went fine. The rule
> statement() is one of the last I added, and I notice that commenting
> it out makes the problem disappear
>
> Gg


It looks to be infinite recursion in one of the JavaCC internal routines
(org.javacc.parser.LookaheadWalk.genFirstSet). I'll look into it.

I had half expected to see left-recursion in your grammar, but I can't
find any. I'd be grateful if someone else could check in case I'm
missing something obvious.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...