[antlr-interest] Mask shift-reduce warning?

Kevin J. Cummings cummings at kjchome.homeip.net
Thu Nov 15 00:09:55 PST 2007


Clifford Heath wrote:
> Randall R Schulz wrote:
>> On Wednesday 14 November 2007 18:18, Clifford Heath wrote:
>>> I have a grammar which has an unavoidable shift-reduce ambiguity,
>> Eh? Am I confused? Aren't "shift-reduce" ambiguities something that
>> only occur in LR parsers?
> 
> Oh, ok, but you know what I mean - what's the equivalent thing in LL
> called?
> It's a situation like the if... else ambiguity, where I want the else to
> bind
> to the closest if.
> 
> Is it possible to tell ANTLR that I know this alternative is ambiguous
> and not to warn me please?

That's what syntactic predicates do.  If you can view far enough ahead
to see what you want, you can avoid ANTLR doing the "wrong" thing.

> Clifford Heath.


-- 
Kevin J. Cummings
kjchome at rcn.com
cummings at kjchome.homeip.net
cummings at kjc386.framingham.ma.us
Registered Linux User #1232 (http://counter.li.org)


More information about the antlr-interest mailing list