I need to automatically construct flowcharts out of C++ code, ideally one flowchart per source file. Is there any tool (preferably C++/Python and either open-sourced or highly configurable - so I may change the look) that I can use to create flowcharts?
相关问题
- how to define constructor for Python's new Nam
- Sorting 3 numbers without branching [closed]
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- How to compile C++ code in GDB?
If you don't mind plaintext output, 'cflow' will do the job. It's in the repositories of at least Debian, and probably most Linux distro's.
clang/llvm
can generate graphviz dot files.Example:
This will output several
.dot
files, one for each function defined inhello.cpp
. You can also generate dominance graph, post dominance graph and more (see here).After you have your
.dot
files you can usedot
to convert it to a.png
file. The.dot
file itself contains only the structure of the graph, so the output ofdot
should be highly configurable (but I am not really familiar with it).Use Enterprise Architect tool.
http://www.sparxsystems.com/enterprise_architect_user_guide/9.2/execution_analyzer/generating_sequence_diagram.html
You can generate sequence diagram while you debug the code.
Demonstration: Online Demo
Note:- This works with C++ code as well. Just use Native debugger.