[antlr-interest] AST construction question

Paul J. Lucas pauljlucas at mac.com
Thu Sep 23 21:22:03 PDT 2004


	I've looked at some sample grammars and I seen both:

		someRule
		    : TOKEN^ foo bar
		        {
			    #someRule = #([SOME_RULE,"SOME_RULE",someRule);
			}
		    ;

	and:

		someRule
		    : t:TOKEN^ { #t.setType( SOME_RULE ); } foo bar
		    ;

	(The former seems fairly verbose.)
	Why would you do one over the other?

	- Paul



 
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