[antlr-interest] Problem when parsing numerics

Gavin Lambert antlr at mirality.co.nz
Tue Feb 24 23:57:34 PST 2009


At 20:39 25/02/2009, Thomas Woelfle wrote:
 >thanks for the tip. Using a syntactic predicate works. But to me 

 >this seems to be a bug in the algorithm that examines the 
minimal
 >amount of lookahread since it calculates a wrong minimal 
lookahead,
 >isn't it?

Yes and no.  Because there's a loop involved, the minimal 
lookahead is infinite, which is a little hard to express in static 
code :)

ANTLR probably could be a little bit smarter and generate the 
synpred for you behind the scenes (which is something I was 
suggesting myself about a year ago), but the current architecture 
and its half-ANTLR-v2-ness apparently doesn't lend itself too well 
to that.  Hopefully that'll get better before too long, especially 
with the upcoming CSharp3 port being self-hosted ;)



More information about the antlr-interest mailing list