[antlr-interest] Thoughts on tree construction

Terence Parr parrt at cs.usfca.edu
Fri May 7 13:08:07 PDT 2004


On May 7, 2004, at 12:55 PM, Mark Lentczner wrote:
> While I see the correspondence between DOM and AST, and I see the
> appeal of dividing information from a parse into attributes and
> elements, I think any real convergence is wrong.

I agree.  The "attributes" of a node are just instance variables in 
your AST implementation such as MyJavaASTNode.

> 1st: The DOM has a tremendous amount of cruft that is very XML
> specific.  None of this would be applicable to parsing.

yeah, i'm not into implementing the DOM, just making DOM able to walk 
ASTs :)

> I could imagine a DOM layer on top of the AST layer.  Then that DOM API
> could be used w/other software that works with DOM.  In this case, many
> features of the DOM would go unused (ASTs have no need for anything
> like a processing instruction...)  I can see the utility of this.  It
> could even be used to walk the AST and produce a canonical XML
> representation of it.  BUT, I don't think it means that the features of
> DOM should be integrated into AST.

Right.  My thought was simply to make ANTLR play well with DOM tools 
etc... I have no love for XML as you all know and don't see myself 
making heavyweight ANTLR tree nodes. :)

Ter
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
Cofounder, http://www.peerscope.com pure link sharing





 
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