[antlr-interest] Conditional grammar

Jose Juan Tapia jjtapia at gmail.com
Tue Oct 18 16:06:09 PDT 2011


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


More information about the antlr-interest mailing list