Skip to content

Parse code into its abstract syntax tree (AST) with libclang and store it in a SQLite database, capturing the essence of code structure for analysis, debugging, and creative exploration.

Notifications You must be signed in to change notification settings

GowayLee/Arborchive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arborchive

Arborchive is derived from the Latin word "Arbor" (meaning "tree") and "Archive" , symbolizing the project's core mission of parsing and storing code structure as a tree(AST).

Arborchive 使用 clang 解析 C/C++ 代码, 并将AST节点信息存入 SQLite 数据库中.

Dependencies

Development Environment

当前开发在以下环境中完成:

  • 操作系统: linux-x86_64
  • 编译器: g++ (gcc version 14.2.1)
  • 依赖
    • clang: clang version 19.1.7

Usage

$ make # 编译
$ make help # 查看帮助信息
$ ./build/demo <Target C/CPP File> # 运行

Example

使用 ./tests/slight.cc 作为目标文件进行测试

$ ./build/demo ./tests/slight.cc

Features

  • 解析 C/C++ 代码
    • 记录变量声明&引用节点
    • 记录函数声明&调用节点 ...
  • 将 AST 节点信息存入 SQLite 数据库中
  • 支持查询结果导出为 CSV 文件 ...

About

Parse code into its abstract syntax tree (AST) with libclang and store it in a SQLite database, capturing the essence of code structure for analysis, debugging, and creative exploration.

Resources

Stars

Watchers

Forks

Releases

No releases published