Re: Declaration, Definition & Reference listers for C

Hans-Peter Diettrich <DrDiettrich@compuserve.de>
24 Aug 2005 18:23:31 -0400

          From comp.compilers

Related articles
Declaration, Definition & Reference listers for C john.carter@tait.co.nz (John Carter) (2005-08-21)
Re: Declaration, Definition & Reference listers for C basile-news@starynkevitch.net (Basile Starynkevitch \[news\]) (2005-08-24)
Re: Declaration, Definition & Reference listers for C codeworker@free.fr (=?iso-8859-1?q?C=E9dric_LEMAIRE?=) (2005-08-24)
Re: Declaration, Definition & Reference listers for C nmm1@cus.cam.ac.uk (2005-08-24)
Re: Declaration, Definition & Reference listers for C Markus.Elfring@web.de (2005-08-24)
Re: Declaration, Definition & Reference listers for C DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-08-24)
Re: Declaration, Definition & Reference listers for C darius@raincode.com (Darius Blasband) (2005-08-24)
Re: Declaration, Definition & Reference listers for C aycock@cse.cpsc.ucalgary.ca (John Aycock) (2005-08-24)
Re: Declaration, Definition & Reference listers for C nicola.musatti@gmail.com (Nicola Musatti) (2005-08-24)
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich@compuserve.de>
Newsgroups: comp.compilers
Date: 24 Aug 2005 18:23:31 -0400
Organization: Compilers Central
References: 05-08-075
Keywords: analysis, tools

John Carter wrote:
>
> I'm interested in the large scale structure of very large programs (1000's
> of files)
>
> So to experiment with this I need to extract every {typedef, struct,
> union, enum, macro, variable and function} {declaration, definition and
> reference} from 1000's of C files.
>
> Anybody know of a tool to parse standard C and spit out this information?


You can use my CtoPascal converter, if you like. It's written in Pascal
(Delphi) and currently processes all declarations, which can be dumped
into text files - including macro definitions, of course. It would be a
nice beta test, with that many files ;-)
I can create a program for you special needs, so that you don't have to
bother with Pascal...


A rudimentary project management is implemented, allowing for global
#define's and #undef's, and AFAIR the processing of multiple files is
possible, eliminating the need for processing common header files for
every single source file (close to precompiled headers).


> I would write one myself, but to do it properly I would have to write
> a C preprocessor and most of C compiler.


The preprocessor/scanner/parser of my tool is C99 conforming, with some
options and extensions for gcc and MS(Visual)C. The design allows for
easy adaptation to other compilers and dialects, if required.


DoDi



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.