Listing all variables of a source code

Discussion in 'C++' started by rusttree@gmail.com, Jun 22, 2005.

  1. Guest

    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.
     
    , Jun 22, 2005
    #1
    1. Advertising

  2. BigBrian Guest

    > 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
     
    BigBrian, Jun 23, 2005
    #2
    1. Advertising

  3. Guest

    cscope
     
    , Jun 23, 2005
    #3
  4. Ron Natalie Guest

    wrote:
    > 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.
     
    Ron Natalie, Jun 23, 2005
    #4
  5. Jaspreet Guest

    wrote:
    > cscope


    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. ;)
     
    Jaspreet, Jun 23, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    0
    Views:
    399
  2. =?iso-8859-1?B?QW5kcuk=?=

    listing all property variables of a class instance

    =?iso-8859-1?B?QW5kcuk=?=, Jun 25, 2007, in forum: Python
    Replies:
    5
    Views:
    293
    =?iso-8859-1?B?QW5kcuk=?=
    Jun 25, 2007
  3. yawnmoth
    Replies:
    12
    Views:
    294
    yawnmoth
    Feb 1, 2009
  4. Wolf Behrenhoff
    Replies:
    10
    Views:
    641
    Uri Guttman
    Aug 13, 2012
  5. Wolf Behrenhoff
    Replies:
    9
    Views:
    440
    Rainer Weikusat
    Aug 4, 2012
Loading...

Share This Page