[antlr-interest] Conditional grammar

Jim Idle jimi at temporal-wave.com
Tue Oct 18 16:07:29 PDT 2011


Gated semantic predicates.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Jose Juan Tapia
> Sent: Tuesday, October 18, 2011 4:06 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Conditional grammar
>
> How can make it so that certain parts of my grammar are only executed
> when a certain condition is met. For example,
>
> method1:
> (myCondtion? INT) STRING;
>
>
> method1 would require that INT STRING if myCondition evaluates to true.
> And only STRING otherwise. I know I've seen this somewhere in the ANTLR
> reference but for the life of me I can't find it again. And all my
> google searches through the newsgroup leads to conditional tree rewrite
> or something similar.
>
>
> --
> José Juan Tapia Valenzuela
> Research Associate
> University of Pittsburgh
> 3076.1 Biological Sciences Tower 3
> Pittsburgh, Pa 15260
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list