This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Extracting all functions from C++ source code
- From: "Larry Martell" <larry dot martell at gmail dot com>
- To: eliss <eliss dot carmine at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 11 May 2008 11:52:42 -0600
- Subject: Re: Extracting all functions from C++ source code
- References: <66cabeec0805091622s154e642ai63dc4d1bad24db21@mail.gmail.com>
On Fri, May 9, 2008 at 5:22 PM, eliss <eliss.carmine@gmail.com> 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