[antlr-interest] Re: Syntatic predicates...

lgcraymer lgc at mail1.jpl.nasa.gov
Mon May 17 13:07:04 PDT 2004


--- In antlr-interest at yahoogroups.com, Tom Verbeure <hombre at g...> wrote:
> Hello All,
> 
> What would prevent me to generously spread around syntatic predicates
> to resolve non-determinisms in my grammar? I've noticed that adding
> them can magically solve a lot problems.

Nothing--I've found that synpreds help in bringing a grammar up.  Once
you have it working, you can go back and carefully refactor to
eliminate many of them.

> 
> E.g.
> rule1 : ruleA
>      | ruleB;
> 
> can give me loads of trouble, while
> 
> rule1: (ruleA) => ruleA
>      | ruleB;
> 
> doesn't. I understand that there may be performance issues or that it

Bingo!  Also maintainability to some extent.

--Loring

> may be considered impure to do this if there are other ways to solve
> it. In addition, it may encourage me not to investigate the core
> reason for nondeterministic rules. (Can a syntatic predicate hide real
> problems?)
> 
> But are there other fundamental disadvantages with this that I should
> be aware of?
> 
> Thanks,
> Tom



 
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