[antlr-interest] Lookahead problems - Bug in C++ Runtime?

Ric Klaren klaren at cs.utwente.nl
Tue Sep 21 02:44:37 PDT 2004


On Fri, Sep 17, 2004 at 04:27:21PM +0200, Martin Probst wrote:
> the attached file is a patch against your antlr-20040907 snapshot. I
> think I've found the problem in TokenBuffer::fill() (see the patch).
> The problem was (as far as I understand it) a wrong condition in the
> loop that appends tokens to the queue ("<=" vs "<"). This made the C++
> TokenBuffer always consume one more token than desired, it was always
> one token ahead of the lookahead.
> I'm not 100% sure this doesn't break other things but at least in the
> corresponding .java file the while loop has the same condition as in my
> patched version.
> I hope this will work for others too, at least it fixes my problems.

Thanks for the patch I'll investigate. I know this <= appeared for a
reason, there was a case where things could go into an infinite loop,
something using a tokenfilter, I'll try and dig up the exact reason and
figure out how to fix things without breaking.

Cheers,

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893755  ----
-----+++++*****************************************************+++++++++-------
     "Evil will always triumph, because Good is dumb." ---  Spaceballs



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list