[antlr-interest] How to pass the current node to the action?

Xie, Linlin linlin.xie at siemens.com
Sat May 9 07:10:02 PDT 2009


Sorry, I didn't give a subject to my last question. Below is the
details, can anybody help me out?

 

From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Xie, Linlin
Sent: 08 May 2009 19:07
To: antlr-interest at antlr.org
Cc: Fitt, Andrew; Hamid, Nusrat
Subject: [antlr-interest] (no subject)

 

Dear All,

 

I'm adding a action at the end of a rule to process each node/subrule.
Here is an example of the rule:

 

P: R1 R2

   ->^(ROOT R1 R2) //ROOT is a pseudo node

  { handleP(...); }

   ;

 

In the handleP action, I want to pass the current ROOT node and also the
following children node R1 and R2. How am I gonna do that? 

 

I know there is a root_0 that could be used to represent the root node
of the rule P, but to the handleP, it just wants to be passed the nodes
that it's interested. 

 

Have anybody got any ideas? 

Thank you all very much!

Linlin Xie

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090509/2a532f5a/attachment.html 


More information about the antlr-interest mailing list