This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
using GCC internal TREE representation.
- From: Sri Sairam Goli <goli at optonline dot net>
- To: gcc at gcc dot gnu dot org
- Cc: goli at lucent dot com
- Date: Thu, 06 Dec 2001 08:05:30 -0500
- Subject: using GCC internal TREE representation.
Hi,
In one of my project I need a tool that parses a c++ file and generates
output which contains all the struct declarations encounetered in the
original c++ file. If struct contains another struct it needs to be
expanded
there.
Say for example if a have a code like this embedded insode any c++
code.
strcu A {
int x;
int y;
};
struct B {
struct A a;
int z;
};
I need an output like this for the second struct
struct B {
struct A {
int x;
int y;
} a;
int z;
};
I am planning to use the gcc to parse my initial file and later walk
through the
internal TREE to dump the output as I need.
I looked at the GCC manual (TREEs usage), but I am not quite sure how
can I
get access to the internal TREE from my own program any pointers in this
regard
will be appreciated.
(If there is any better way of doing the same thing instead of using the
gcc TREEs
please suggest me).
Thanks,
goli