[antlr-interest] Example code with multiple AST passes?

Don Caton dcaton at shorelinesoftware.com
Mon Jun 20 11:25:28 PDT 2005


 

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org 
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of 
> Rodrigo B. de Oliveira
> Sent: Monday, June 20, 2005 1:05 PM
> To: Bryan Ewbank
> Cc: ANTLR Interest
> Subject: Re: [antlr-interest] Example code with multiple AST passes?
> 
> Yes. That's what I've been using for the boo compiler. The 
> compilation process is described  by a CompilerPipeline 
> object which is basically a list of CompilerStep objects (the 
> actions, mostly implemented as visitors). The first step is 
> generally the parser which constructs the AST from the input 
> files. The intermediate steps apply transformations and 
> annotations to the tree. The last step generally outputs something.
> 
> It works great but it's based on a automatically generated hetero AST.

You're doing this with Antlr?  Sounds like an interesting approach.  If I
understand correctly, you're passing some sort of object to the tree parser
constructor that contains the action code for that pass?  If so, how do you
associate the methods in the class with the rules in the parser?

> 
> Rodrigo
> 




More information about the antlr-interest mailing list