[antlr-interest] Re: bad generated code?

Ric Klaren ric.klaren at gmail.com
Mon Oct 3 15:24:01 PDT 2005


Terence Parr wrote:
>> Tree parsers have to be k=1 because they are actually two dimensional
>> and it gets too weird to allow k>1.  Syntactic predicates should
>> work, though.
> 
> 
> Hi :)  ANTLR v3 allows k>1 lookahead trivially I'm happy to say.  I 
> didn't have my brain working for v2 ;)

Though it looks like a bug for v2 ;) I browsed a bit around in the
changelogs and the code earlier this evening. I'm not sure where it's
triggered. I would currenlty guess in the analysis since there's no
changes (I think) in the codegenerator that could do this (or this is a
sleeper bug). For some reason it uses k > 1, anycase the && between the
terms looks strange... can it have to do with semantic predicates?

The (trimmed down) grammar files would be a help to track it down.

Cheers,

Ric


More information about the antlr-interest mailing list