[antlr-interest] ANTLR 3.0 question about common actions

Monty Zukowski monty at codetransform.com
Wed Jul 28 14:22:56 PDT 2004


On Jul 28, 2004, at 2:09 PM, Tiller, Michael ((M.M.)) wrote:

> So your parsers/walkers might look something like:
>
> class CalcTreeWalker extends TreeParser;
>
> expr
>   :  #(PLUS a=expr b=expr) $add(a,b)
>   |  #(STAR a=expr b=expr) $mult(a,b)
>   |  i:INT		         $intLiteral(i)
> 	;

One thing we're currently used to in ANTLR is having one 
function/method per rule and treating it like a method in that we can 
pass in arguments, define variables, and share those variables between 
alternatives.  Does SLK allow that kind of thing?

Monty

ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit -- 
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list