[antlr-interest] accessing the current node

Greg Smolyn smolyn at cs.ubc.ca
Tue Feb 19 13:25:59 PST 2002


Thanks for the help, Monty. 

I just have one other dumb question that is causing me difficulty at the 
moment, can anyone help?

Say I have some structure like this:

  pointcut1 && pointcut2 && pointcut3
(yadda yadda)

Currently my grammar is something like (yes, what I'm showing here is 
broken... it's somewhere between what I had and what I want!):

pointcut
    : pointcuts (binaryPointcut)*
    ;

pointcuts
   : "execution" LPAREN! functionSig RPAREN! body
   { ## = #(NPointcut, ##); }
   ;

binaryPointcut
  : binaryPointcutOp^ pointcuts
   { ## = #(NPointcut, ##); }
  ;

binaryPointcutOp
   : LAND
   | LOR
   ;

for reasons of simplicity in my aspect weaver, I want to turn the "&&" into a 
type of pointcut itself-- basically I want to create

andPointcut(andPointcut(pointcut1, pointcut2), pointcut3)  (I *think* that's 
the right order of operations?)./

I'm really stuck in a LALR world right now in my head, and I can easily come 
up with a yacc solution. :)  Does anyone know the ANTLR way to do this?  


thanks!

-- 
Greg Smolyn (smolyn at cs.ubc.ca)
Software Practices Lab, UBC
http://www.cs.ubc.ca/labs/spl/

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list