There are lots of code analysis softwares that could help programmers grab the code structure quickly, such as sourceInsight, understand, Crystal flow, Code visual to Flowchart, easy structure, code to chart… Todaty, I ‘d like to introduce a simple solution to obtain the function scheduling relations, and class structure, Doxygen + Graphviz.
Google/ Baidu these softwares, install them by clicking “NEXT”…
useful links: http://sourceforge.net/projects/doxygen/, http://www.graphviz.org/Download..php
Easy to use
- specify the working directory
- Go to Wizard, to configure roughly
- [wizard/project] fill in the project infos and specify the source code directory and output directory
- [wizard/mode] select programming language
- [wizard/output] select ouput formats, usually HTML.
- [wizard/Diagrams] select “Use dots tool from Graphviz”, and select “call graphs” and “called by graphs”
- Go to Expert, to set up more details
- [expert/project] set “DOXYFILE_ENCODING” into UTF-8 in case some encoding issues. and set the language.
- [expert/build] usually, configure to extract all (personally, make first 5 items selected). or keep default
- [expert/input] if using Chinese, set INPUT_ENCODING: GB2312.
- [expert/Dot] make these items selected: UM_LOOK, CALL_GRAPH, CALLER_GRAPH, and specify the dot directory (XX/Graphicvizxxx/bin).
- Go to Run, enjoy it.
Usually, there are 5 kinds of comment grammars:
- Variables, Marco, type definitions
- enumerations, Struct.
Refer to Doxygen Manual DoxgenComments DoxngenQuickStart