tags:

views:

89

answers:

2

When I work on someone else's code, I tipically need to abuse of grep in order to find data types declarations etc, and this usually makes me confused.

I'd like to have some tool which analyzes the source code and produces some graphviz-like drawing and allows me to follow dependencies.

Also I've found this on the internet, but I think is taylored for the linux kernel only.

+5  A: 

Have you tried doxygen?

Doxygen can produce dot files, and you can build the docomentation without changing the source code with the right options set in the Doxyfile.

swegi
Is doxygen provided with some graph drawing facility? This would be great, however you may find some project which is not documented by doxygen...
Dacav
Yep, Doxygen can draw dependency graphs even if your source is not annotated.
Thomas
@Thomas oh really? +1 for you and accepted answer for @swegi then! Thanks bros!
Dacav
+1  A: 

Do you use an editor that can take advantage of tags ? In Emacs, I just type M-. to go to the definition of a symbol, and M-* to go back to where I was once I have read it. This also enables the command tags-search to grep among the files of the software project (very convenient if they are in multiple directories).

Pascal Cuoq
Well, actually you can use something like "grep -riIn foo ." and find recursively what you search for. Those tags also seems to be interesting, even if it's not exactly what I was searching for. +1 anyways.
Dacav
I used `grep -r` too, but when we switched to SVN, it started to report matches in .svn copies of files, which was annoying, so I gave up on it instead of looking for a way to exclude directories.
Pascal Cuoq
@Pascal Cuoq, you can put in pipe "grep -v '\.svn'" to your grep... and this filters out all .svn directories. Btw, another reason not to use svn: it's clumsy.
Dacav