Move language parser and function call graph analyzer
Project description
Move FCG Analyzer
一个用于分析 Move 项目的静态分析工具,支持函数调用图(Function Call Graph)分析,可以提取函数信息、调用关系、参数等。
功能
- 提取函数签名、参数、返回类型
- 提取函数源代码和位置信息
- 准确提取函数调用关系(calls)
- 支持模块限定的函数查询
- 输出标准 JSON 格式
构建
1. 安装依赖
npm install
2. 构建 TypeScript Indexer
npm run build:indexer
使用
Python API
from move_fcg_analyzer import MoveFunctionAnalyzer
analyzer = MoveFunctionAnalyzer()
result = analyzer.analyze_raw("./project_path", "function_name")
# result 包含 contract, function, source, location, parameter, calls 等字段
print(result["calls"]) # 查看函数调用关系
命令行
python3 -m move_fcg_analyzer <project_path> <function_name>
示例:
python3 -m move_fcg_analyzer ./test/caas-framework grant_read_authorization
输出格式
{
"contract": "module_name",
"function": "function_signature",
"source": "function_source_code",
"location": {
"file": "/path/to/file.move",
"start_line": 134,
"end_line": 204
},
"parameter": [
{"name": "param_name", "type": "param_type"}
],
"calls": [
{
"file": "/path/to/called/function.move",
"function": "called_function_name",
"module": "called_module_name"
}
]
}
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
move_fcg_analyzer-1.0.5.tar.gz
(227.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file move_fcg_analyzer-1.0.5.tar.gz.
File metadata
- Download URL: move_fcg_analyzer-1.0.5.tar.gz
- Upload date:
- Size: 227.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
976191d8d4b2863273fd7696acc367dfc8a3e38f1d2629e0c302695c631fc3db
|
|
| MD5 |
86ab079555336e791902acfaee3f81f0
|
|
| BLAKE2b-256 |
d7b0d5c4b380cc00489e997f32f10cd670cfca94c29e1550eaef5b1e974bc195
|
File details
Details for the file move_fcg_analyzer-1.0.5-py3-none-any.whl.
File metadata
- Download URL: move_fcg_analyzer-1.0.5-py3-none-any.whl
- Upload date:
- Size: 44.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77a913648e4781e6bd573eb4951a9bc114bc1f0654f09e3bdc01b5bc676f4185
|
|
| MD5 |
b62c5585d3642ca40da0d668596c9d32
|
|
| BLAKE2b-256 |
217a40cd08f7fb186f8f9f0197f2ecd817d18f7564fdec8fa255ef888113d55f
|