[antlr-interest] conditional processing

Mark Volkmann r.mark.volkmann at gmail.com
Mon Nov 26 19:02:46 PST 2007


Part of my AST looks like this.

^('if' condition simpleStatement)

In my tree grammar, the rule for "condition" evaluates the matching
content to true or false. The rule for "simpleStatement" executes the
statement, for example, it could be a simple print statement. I only
want simpleStatement to be executed if condition evaluates to true. I
haven't been able to figure out how to make this work because when
this part of my AST is matched, the rules for both condition and
simpleStatement are fired.

I'd appreciate any hints on how to achieve this.

-- 
R. Mark Volkmann
Object Computing, Inc.


More information about the antlr-interest mailing list