[antlr-interest] AST matching and N-ary tree nodes.

Bryan Ewbank ewbank at synopsys.com
Thu Oct 7 07:21:08 PDT 2004


Hi Folks,

I've been building flattened trees for things like argument lists, but am
now encountering a question of how to process these nodes in a general way,
since AST matching is generous...

	// Used to use this
		arglist : arg ( COMMA^ arg )*

	// Now use this
		arglist : arg ( COMMA! arg )*
			{ #arglist = #( #[ARGLIST], #arglist)

The problem is that I don't know how many kids the ARGLIST node can have,
and I don't see a way (v 2.7.4) to easily walk the children.

Am I building this tree in a non-ANTLR style?  Do I need to go back to using
the "COMMA^" model?

- Bryan Ewbank
"The best tool for requirements analysis and design is a crayon"



 
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