[antlr-interest] Lexer context problem

Steve Bennett stevagewp at gmail.com
Sun Nov 25 03:46:36 PST 2007


On 11/24/07, Gavin Lambert <antlr at mirality.co.nz> wrote:
> You could try using a gated predicate (put => after the ?).  I'm a
> little fuzzy on the exact behaviour but I think this makes it a
> decision-making predicate instead of just a verification predicate
> -- so it's stronger.

Yep. the ...: {expr}? rule; construct is a disambiguating semantic
predicate which only gets invoked if there is actually an ambiguity.
The gated semantic predicate: {expr}?=>rule; is the one to use here.

Steve


More information about the antlr-interest mailing list