This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]