Extracting all functions from C++ source code
\ eliss (9 May 2008)
. \ Eljay Love-Jensen (10 May 2008)
. \ Larry Martell (11 May 2008)
. . \ Maurizio Vitale (12 May 2008)

2 msgForce GCC to unroll a loop?
5 msgSyslog fixes a bug?
2 msggcc 4.2.x large file support
2 msgWindows DEP problem with nested functions
8 msgPorting GCC to 8051 Microcontroller
2 msgCleanup for thread local storage?
3 msgGCC 4.3.2 Install into Cygwin
4 msggcno file doesn't include uncalled member funct...
3 msgGCC 4.3.0 configure failure: libgcc
2 msglex/yacc
1 msgBuilding trunk -- error msg instrucitons not qu...
2 msgMIPS atomic builtins
3 msgEnabling loop unrolling in small sections of code.
1 msg#pragma warning
2 msgProblems building gcc 4.3
8 msggcc 4.3.0 -- program search path issue
1 msgRe: WELCOME to gcc
2 msgInclude paths for cpp/g++ (gcc 4.3.0)
2 msgLinking a library and source file into another ...
Subject:Re: Extracting all functions from C++ source code
Group:Gcc-help
From:Larry Martell
Date:11 May 2008


On Fri, May 9, 2008 at 5:22 PM, eliss <eliss.carmine> wrote:
> I'm trying to find a way to extract all the function definitions AND
> function uses from thousands of C++ files. For example, if foo.cpp
> contains:
>
> int func(char b)
> {
> return 0;
> }
>
> func('d'); func('e');
> print("bar");
>
> Then I want to get something that tells me "int func(char b) is the
> declaration on line 1, pos 0 ; func(char) is on line 5, pos 0 ;
> func(char) is on line 5, pos 11 ; print(char*) is on line 6, pos 0"
>
> Can I use gcc or g++ to do this? I've looked into ctags, but it can
> only get the function definitions (and they are partial or cutoff
> sometimes). I've also tried rolling my own but the amount of grammar
> that can be used overwhelmed me.

Take a look at doxygen - I think that can do what you want.

-larry


© 2004-2008 readlist.com