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

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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> # 运行

Makefile Commands

The Makefile provides several useful commands for building and running the project:

# Build the project with default settings
$ make

# Build with debug flags enabled
$ make debug

# Build with release optimizations
$ make release

# Build and run the demo with test file
$ make run

# Clean up all build artifacts
$ make clean

# Show available make commands
$ make help

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