I create an interface which handles all information from all rules  
then create the separate classes implementing that interface. The tree  
walker then calls against the interface and the driver program  
installs the relevant class. This works very well and requires only  
one copy of the tree grammar. If you rewrite the AST you may need two  
grammars.

In general do not put anything but interface calls in actions.

Jim

On Jul 30, 2009, at 8:48 AM, Rob Dougan <[email protected]> wrote:

> Antlr 3.1.3 does not have tree filters.
>
> Pass 1: lex/parse produces AST,
>
> I would like to do multi-pass processing on AST produced in first  
> pass.
>
> Pass 2: Tree grammar A (AST): variable defs, build symbol table etc
> Pass 3: Tree grammar B (AST): static type checking etc.
> Pass 4: Tree grammar C (AST): execute
>
> If i do not have tree filters, do I have copy the tree grammar three  
> times and modify the actions to accomplish the task?
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to