Hi, gurus, I defined a tree grammar which contains if statements, it looks like
below:
ifs: ^(IF test elseif_part else_part) ;
In normal, this rule will generate source code as below:
test(); //it will return a boolean value
....
elseif_part();
....
else_part();
As you see, if the rule 'test' is ok in some conditions, there's no need to
evaluate rule 'elseif_part' and 'else_part'.
What I need is conditional tree node expansion. Ideally generated code in my
mind:
if (test())
{
//skip elseif_part and else_part
}else{
elseif_part();
if (some condition was satisfied){
//skip else_part;
}else{
else_part();
}
}
Hope for you help, thanks!
This email (including any attachments) is confidential and may be legally
privileged. If you received this email in error, please delete it immediately
and do not copy it or use it for any purpose or disclose its contents to any
other person. Thank you.
本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。
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.