This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
AST to XML
- To: gcc-help at gcc dot gnu dot org
- Subject: AST to XML
- From: "Jeremias A. Sauceda" <pi314 at iastate dot edu>
- Date: Sun, 18 Mar 2001 02:05:02 -0600
Hello,
I am a research assistant at Iowa State's Software Reengineering Lab.
Last semester I created a program to convert Edison Design Group's
Intermediate Language files (an Abstract Syntax Tree) into XML.
Unfortunately their C/C++ front end does not support many gcc
extensions. I would like to use GCC's front end instead, since it
obviously support gcc extensions and is open source. I desperately need
gcc extensions since I am analyzing the Linux Kernel, which is very
biased to gcc.
There are two reasons why EDG's front end was chosen. The abstract
syntax tree it creates is a complete representation of the source code,
no optimizations are done. We received the full source code (after
signing an NDA). We need a pristine representation of the source code
since we are doing high level analysis of code; for automatic MPI
parallelization, slicing, etc.
By glancing through tree.h and tree.def I think that most of the
information I need is present except for line and column numbers. I
need at least the block start and end points, preferably those of
statements, optimally of all expression terminals. Is this already in
the tree? What do I have to do to add it?
Ultimately I would like to create an XML backend to gcc. So instead of
an object file I get an XML AST. What do you think?
Thanks,
Jeremias Sauceda