Hi all.
I am developing a tree parser, and I have a problem with the if/then/else
construction.
My AST tree has the following formats for conditional statements:
^(IF condition ^(THEN statements)) |
^(IFELSE condition ^(THEN then_s=statements) ^(ELSE else_s=statements))
I don't know how to skip THEN statements when the condition is false.
I am trying the following:
conditionalifthen:
^(IF expression ( { $expression.value != 0 }? => ^(THEN statements) | .));
conditionalifthenelse:
^(IFELSE expression
( { $expression.value != 0 }? => ^(THEN statements) . |
. ^(ELSE statements) ));
without success, until now.
Any clue of how can I solve this problem, or which documentation can I
follow?
Thanks a lot.
Greetings,
--
David Marín Carreño
S.I.C.E.
Dirección Técnica.
Tfno 91 623 22 30
E-mail: [email protected]
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---