[antlr-interest] Re: Can Resolvers etc be written as ANTLR tree parsers?

micheal_jor <open.zone at virgin.net> open.zone at virgin.net
Mon Jan 13 20:53:53 PST 2003


> > I am a total ANTLR TreeParser newbie. Having read the docs again, 
I felt
> > that Resolvers and SymbolTale population are things that it 
should be
> > possible for a TreeParser to do. Am I right or have I missed 
something
> > fundamentally?
> 
> That sounds like a tautology...

Perhaps not to a treeparser newbie?  ;-)

> Sure, you can walk a tree and gather whatever information is 
available from
> the tree.

OK.

> The trick is to build the initial AST with sufficient 
information. :-)
> A canonical example seems to be mapping back to the source with 
position
> information.

Isn't this a Lexer issue?. Ensuring the info is captured by the lexer 
in the first place?

> Remember that you can:
> 
> 	* make multiple passes over the tree
> 
> 	* transform the tree into "better" trees
> 
> 	* create auxiliary structues that you thread through the tree

An example would be?

> > If there are examples of resolvers etc written as ANTLR tree 
parsers, I'd
> > appreciate a link/sample.
> 
> In this context, what do you mean by "resolvers"?

A processing entity that traverses an AST and links ID nodes to their 
defining occurences, resolving overloads and expression types. [Might 
make mutiple traversals.]

Micheal



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list