From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9909 invoked by alias); 6 Dec 2001 13:19:33 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 9204 invoked from network); 6 Dec 2001 13:19:00 -0000 Received: from unknown (HELO ool-18ba7a4e.dyn.optonline.net) (24.186.122.242) by sources.redhat.com with SMTP; 6 Dec 2001 13:19:00 -0000 Received: from optonline.net (localhost.localdomain [127.0.0.1]) by ool-18ba7a4e.dyn.optonline.net (8.11.6/8.11.6) with ESMTP id fB6D5Ub02972; Thu, 6 Dec 2001 08:05:31 -0500 Message-ID: <3C0F6D19.BCB420B@optonline.net> Date: Thu, 06 Dec 2001 06:07:00 -0000 From: Sri Sairam Goli X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.7-10smp i686) X-Accept-Language: en MIME-Version: 1.0 To: gcc@gcc.gnu.org CC: goli@lucent.com Subject: using GCC internal TREE representation. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2001-12/txt/msg00276.txt.bz2 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