[antlr-interest] CommonTree & Tree grammar versus DIY

Carter Cheng carter_cheng at yahoo.com
Mon Aug 11 13:29:27 PDT 2008


I have been working on a compiler system for a dialect of an existing language and so far I have been using the ^() syntax to generate the "AST" using ANTLR's tree construction routines. 

The difficulty I have been facing is how best to manipulate these trees during subsequent passed through them especially if multiple passes are needed to check for various properties, construct the symbol table and for type checking. Would this entail using multiple tree grammar files one for each pass?

It seems that it might be easier at present to DIY the AST construction using a tailored representation to the grammar in question as would be done if I was using something like YACC. 

Is this really the case or are there compelling reasons for using the ^() syntax? 

Thanks in advance,

Carter.


      


More information about the antlr-interest mailing list