Hello,
I was wondering if it is possible to execute actions for rules, that calls
other rules, before executing the actions for the rules, that were called.
Let's say I have the following grammar:
---------------------------------------------------------------
block_rule: BLOCK block_name
'{'
property1_rule
NEWLINE
property2_rule
'}' { // generate block of statements say s3 } ;
property1_rule: property1= value1 { // generate block of statements say s1 }
;
property2_rule: property2= value2 { // generate block of statements say s2 }
;
block_name: ID;
property1: ID;
value1: ID;
property2: ID;
value2: ID;
---------------------------------------------------------------
I would want the actions for rule block_rule to get executed before the
actions of property1_rule or
property2_rule
I am trying to do sth like:
-----------------------------------------
block_object block_name;
block_name.property1= value1;
block_name.property2= value2;
-----------------------------------------
but what i get is:
-----------------------------------------
block_name.property1= value1;
block_name.property2= value2;
block_object block_name;
-----------------------------------------
Just in case it matters, what i am actually doing is using the parser
grammar to generate an AST, and then using a tree grammar to walk the tree.
Thank you for your time :)
Best Regards,
Amr Muhammad
Cairo Univ. Computer Eng. Grad.
twitter:@amrmuhammad <http://twitter.com/amrmuhammad>
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.