Dear All,
I have a question about the time of execution of the actions put inside
or at the end of the rules. I can see from the generated lexer or parser
code that the actions (at the end of the rule) are inserted after the
match of the whole rule. But I would like to know if any actions (in the
middle or at the end) would be executed before the match of the rule?
i.e. at the Look Ahead (Prediction) stage, would the match of a part of
the rule trigger any actions of the subrule matched?
For example:
Rule : Rule1| Rule2;
Rule1 : Rule3* Rule4;
Rule2 : ( Rule3 Rule3 )* Rule5;
Rule3 : AnyRule { AnyAction; };
Rule4 : xxx;
Rule5 : yyy;
When trying to find out if the input matches Rule1 or Rule2, will the
AnyAction be executed? Or if the action is in the middle of the rule,
will it be executed before the match of the full rule?
I haven't found out any theoretical confirmation from the book, so would
like to ask if anybody can confirm how it works.
Thanks.
Linlin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address