[antlr-interest] Syntactic anti-predicates

Steve Bennett stevagewp at gmail.com
Sat Feb 9 09:53:22 PST 2008


Is there a convenient way to say "if the upcoming tokens look like X Y
Z" then *don't* match this rule? It seems I always have to resort to a
semantic predicate like this:

{input.LA(1) != X && input.LA(2) != Y}? =>  R

or some complicated rule that amount to not X Y Z:

(notXYZ) => R

Is there a simple way I'm missing?

Thanks,
Steve


More information about the antlr-interest mailing list