[antlr-interest] Thoughts on tree construction
Oliver Zeigermann
oliver at zeigermann.de
Fri May 7 14:21:22 PDT 2004
Tiller, Michael (M.M.) wrote:
One last comment thought on this idea. As far as I can tell, there
> really isn't a formal mechanism for validating an AST in ANTLR or
> formally stating it. The tree walker grammar formally describes this,
> but it isn't very useful outside of ANTLR. I could imagine that if ASTs
> were based on XML, part of the compiler process could be to
> automatically formulate a DTD (or other type of schema) for the AST that
> would be generated. If you work completely within ANTLR, this might not
> be useful, but if you were to interact with other tools, such a formal
> statement of the tree structure might be useful.
DTDs are only useful in the XML world, ANTLR tree grammars in the ANTLR
world. Are you thinking of some sort of transformation from DTD to tree
grammar? Or the other way round? What for? A DTD is only good for
validation while tree grammars usually contain both analysis and
synthesis. The synthesis part of XML usually is contained in informal
code that works on the DOM, SAX, JDOM or whatever data structure. So
tree grammars are much more poweful than a DTD or a Schema. Comparing
ANTLR tree grammars to transformation languages like XSLT would make
much more sense.
Oliver
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