[antlr-interest] Re: High level semantic analysis
Tiller, Michael (M.M.)
mtiller at ford.com
Wed May 21 05:35:13 PDT 2003
> From: mzukowski at yci.com [mailto:mzukowski at yci.com]
> Subject: RE: [antlr-interest] Re: High level semantic analysis
>
> TNode.java--has support for double linking (so a node can
> find its parent)
> which is currently unused. To use it you would first build
> the complete
> tree and then call doubleLink(). TNode Also has a slot for
> the defNode, the
> idea being to have a tree pass which annotates every use of a
> variable with
> the definition to make it easy to find the definition without
> having to keep
> track of the current scope. It also has a Hashtable of
> attributes so you
> could put anything you want in for the node. That is how you
> decorate trees
> in ANTLR.
For ANTLR 3, it would be nice (for people like me) if a "rich" AST node type was included that implemented references to parent nodes and some kind of hash or map structure for annotating the AST with additional information. I'm sure I can figure out how to write my own, but it seems like this would be a really common need and having a built-in type would just spare everyone the exercise of implementing such a node.
--
Mike
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list