[antlr-interest] Re: How to make antlr parse this

Monty Zukowski monty at codetransform.com
Sat Apr 17 14:57:42 PDT 2004


>
> fluff : ((comment comment)=> comment)* flufftail
> flufftail : (comment)=> ( (invariant typedef)=> empty | comment ) | 
> empty ;
>
> But, alas, Antlr doesn't support syntactic predicates as predictors of 
> (...)* loops.
> (Terence, are you listening?)

Ter has explained this to me a few times now, though I still can't 
remember how it goes.  It's something like if you allow a predicate to 
break out of a loop it would require a modification to follow set 
computation.  It might be able to be nailed down to a more specific set 
of cases for antlr 3.

By the way, I would probably not deal with this in the parser, I would 
handle it in a tree pass where it would be really easy to search back 
from a typeDefinition to see if an invariant preceeded it.  Of course 
that assumes you are building trees.

Monty
ANTLR Consultant
www.codetransform.com



 
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