[antlr-interest] Can I use ANTLR to build a tree from C code

shivatk shivatk at yahoo.co.uk
Thu Apr 3 11:09:48 PST 2003

Hi all,
 My name is Shiva. I have joined the group today. I have been working 
on 'Program Analysis', 'Reverse Engineering', 'Migration and 
restructuring tools' and similar language processing stuffs for the 
last 4 years. In all the areas the initial step is the same - build a 
tree from the source code. So, whether the code is in C, or in C++, 
or in COBOL we build the tree first. To do this we use 'yacc' based 
parser and our own internal tool to build the AST. Most of the 
actions in the parser are written to build the tree and capture other 
informations like line number, line pos, filename etc. 
 With regards to this I have a question to post. 
 Can I use ANTLR to do the same? I mean, can I use ANTLR to parse and 
build an AST out of C code? Will I be able to capture the line num, 
column position inormation in the tree nodes? And, will I be able to 
create associations between a tree node for a variable to its 
declaration in the symbol table?

 Hoping for an early reply from the group. 



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

More information about the antlr-interest mailing list