Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

searching for c++ code parser to see all signatures

I'm looking for a c++ parser which is able to extract all the functions and methods with its signatures. Is there something like this?

I had a look at gccxml there I have the problem, that it is not able to use namespaces and its not fine when only a header file is present.

like image 309
develhevel Avatar asked May 13 '11 13:05

develhevel


2 Answers

Most obvious options:

  1. ctags
  2. cscope

Just a sample of the GCC man page:

-fdump-noaddr -fdump-unnumbered -fdump-translation-unit[-n] -fdump-class-hierarchy[-n] -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline
           -fdump-statistics -fdump-tree-all -fdump-tree-original[-n] -fdump-tree-optimized[-n] -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias -fdump-tree-ch -fdump-tree-ssa[-n] -fdump-tree-pre[-n] -fdump-tree-ccp[-n] -fdump-tree-dce[-n]
           -fdump-tree-gimple[-raw] -fdump-tree-mudflap[-n] -fdump-tree-dom[-n] -fdump-tree-dse[-n] -fdump-tree-phiopt[-n] -fdump-tree-forwprop[-n] -fdump-tree-copyrename[-n] -fdump-tree-nrv -fdump-tree-vect -fdump-tree-sink -fdump-tree-sra[-n]
           -fdump-tree-fre[-n] -fdump-tree-vrp

Also there is a gccxml backend

like image 167
sehe Avatar answered Oct 03 '22 18:10

sehe


The Clang compiler obviously has the functionality to do this, if I remember correctly there's even an API to access the code tree generated by the parser.

like image 33
Milan Avatar answered Oct 03 '22 19:10

Milan