|C parser email@example.com (Siddharth Choudhuri) (2004-07-28)|
|Re: C parser firstname.lastname@example.org (Rajaram) (2004-08-04)|
|Re: C parser email@example.com (jacob navia) (2004-08-04)|
|Re: C parser firstname.lastname@example.org (Daniel C. Wang) (2004-08-04)|
|Re: C parser email@example.com (2004-08-05)|
|C parser firstname.lastname@example.org (=?gb2312?q?sky=20yan?=) (2004-08-05)|
|Re: C parser email@example.com (2004-08-10)|
|Re: C parser firstname.lastname@example.org (Siddharth Choudhuri) (2004-08-11)|
|C parser email@example.com (DAVID) (1997-07-16)|
|Re: C parser firstname.lastname@example.org (Dave Hanson) (1997-07-18)|
|Re: C parser email@example.com (1997-07-22)|
|From:||firstname.lastname@example.org (Michael Tiomkin)|
|Date:||5 Aug 2004 14:12:12 -0400|
|Posted-Date:||05 Aug 2004 14:12:12 EDT|
Siddharth Choudhuri <email@example.com> wrote in message news:04-07-079...
> I am looking for a C parser that can generate a list of all variable
> names, their type (int, char...) and scope (auto, static, ...) by reading
> a C source file.
You'd like to run this parser with the same -D definitions as your
original compiler. I would prefer to use the same compiler with the
same options because some of these options can introduce additional
#define's and change your source.
Instead of reading the source file you can read the object file (.o
or .obj) after compilation. For example, 'nm file.o' will give you
some info about external variables, but not about the automatic vars.
For better info you'd like to compile your source with symbol table
and/or debug info, and read this info from the object file. Notice
that some of the variables would have a complex type, e.g. structures,
unions and functions. You would have to find a way to deal with
definitions of these complex types together with definitions of the
Return to the
Search the comp.compilers archives again.