Hi Jim,
Thanks for your previous replies. How does the fixation of the conversion to common token bug go? As I can use labels for all the sub-rules, but can't do it to the current rule, as the example shown: P: r1=rule1 r2=rule2; I can use labels for rule1 and rule2, but can't assign rule P to any label and use the label to refer to the current rule. If you can fix that as soon as possible, that'd be great! Also this problem probably has some connection with the ADAPTER->rulePostProcessing( ADAPTER, root_0 ) function. Though having read the code for the function, I still couldn't get a consistent picture of how it works. To me, sometimes the rulePostProcessing cuts the root_0 node, and sometimes it doesn't for the same situation of having a single child in a rule. So I wonder if you can explain to me how exactly this function works? Or is there any signal or parameter that I can use to switch off the cut off of the root_0 (i.e. the prioritization of the tree)? I suppose if the $tree can be used (i.e. the bug above fixed), and I attach some user data to the user pointer of the $tree, the rulePostProcessing has to do something to pass on the data when it has to cut off the root_0, right? I look forward to your reply. Thank you very much. Regards, Linlin From: [email protected] [mailto:[email protected]] On Behalf Of Jim Idle Sent: 11 May 2009 18:04 Cc: [email protected] Subject: Re: [antlr-interest] How to pass the current node to the action? Xie, Linlin wrote: Hi Jim, The weird thing is if I use the $rule1.tree directly, the generated code would try to convert the rule1_return structure to common token type first, but if I assign the rule to a variable, say P: r1=Rule1 Rule2; then using $r1.tree would be completely fine, as the generated code would just keep the rule1_return structure, not trying to convert it at all. Can you see why it works this way? Thanks a lot. Maybe a bug in code generation templates, I will take a look, but for now, use labels :-) Jim --~--~---------~--~----~------------~-------~--~----~ 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
