cxx2flow
将 C/C++ 代码转换为流程图
效果
两种样式:
折线 | 平滑 |
安装
自行编译
cargo install cxx2flow
下载预构建二进制
可以到 GitHub Actions 或 Nightly.link 下载最新构建的二进制,包含 Linux 和 Windows 版本。
使用
为了编译生成的 dot 文件,你需要安装 graphviz,并将其添加到 PATH 中。也可以将生成的结果复制进在线的 graphviz 服务中,如 http://viz-js.com/ 。
cxx2flow 0.1.5
mgt.
Convert your C/C++ code to control flow chart
USAGE:
cxx2flow [FLAGS] [OPTIONS] [FUNCTION]
FLAGS:
-c, --curved Sets the style of the flow chart.
If specified, output flow chart will have curved connection line.
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-o, --output
限制
- 暂时不支持 do-while,switch 和 goto
- 不支持预处理器,如 include, ifdef, ifndef...
- 支持的控制流语句有:while,for,if,break,continue,break,return。