我正在寻找一个免费的软件,工具,库或其他任何来分析C++代码.
据我所知,像"Cppcheck"这样的"静态代码分析"工具对我没有帮助,因为我无法定义自己的规则或输出.我想,一个给我一个C++文件的AST(抽象语法树)的库是最好的.
我的目标是编写一个命令行工具,该工具生成包含以下内容的输出:
Test.cpp:
The file contains 42 global Integers.
The Class Test has the following attributes:
String name,
Int size.
The Class Test contains the following global functions:
void Test(),
int getTestSize(),
String renameTest(String newName).
Run Code Online (Sandbox Code Playgroud)