Listing all variables of a source code

R

rusttree

I've been tasked with a project to take a large program coded in c++
and a generate a list of the names of every variable and where they are
declared. Are there programs out there that will do something like
that?

If this is a snippet of code:

void someFunction(){
int foo;
char bob;
...
}

The output I need would look like this:

someFunction
->foo (int)
->bob (char)

Thanks.
 
B

BigBrian

I've been tasked with a project to take a large program coded in c++
and a generate a list of the names of every variable and where they are
declared. Are there programs out there that will do something like
that?

If this is a snippet of code:

void someFunction(){
int foo;
char bob;
...
}

The output I need would look like this:

someFunction
->foo (int)
->bob (char)

Thanks.

Doxygen
 
R

Ron Natalie

I've been tasked with a project to take a large program coded in c++
and a generate a list of the names of every variable and where they are
declared. Are there programs out there that will do something like
that?
You probably want to google for "crossreferencing" or xref tools for
C++. There are code comment extraction programs like DOC++ or
Doyxgen that probably do this as a side effect as well.
 
J

Jaspreet


I dont think cscope is going to satisfy him/her since he/she needs
names of all the variables declared in a function. However, if he/she
knew the names, then cscope could tell where all the variable has been
defined and/or used.

OR probably I am still using a real old version of cscope which does
not have this feature. ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top