GitHunt
NA

AST2DB is a powerful tool that utilizes clang to parse C/C++ source code, extract Abstract Syntax Tree (AST) information, and store it in an SQLite database.

AST2DB

AST2DB uses clang to parse C/C++ code and stores AST node information into an SQLite database.

Dependencies

Development Environment

Current development is completed in the following environment:

  • Operating System: linux-x86_64
  • Compiler: g++ (gcc version 14.2.1)
  • Dependencies
    • clang: clang version 19.1.7

Usage

$ make # Compile
$ make help # View help information
$ ./build/demo <Target C/CPP File> # Run

Example

Using ./tests/slight.cc as the target file for testing:

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

Features

  • Parse C/C++ code
    • Record variable declaration & reference nodes
    • Record function declaration & call nodes
      ...
  • Store AST node information in an SQLite database
  • Support exporting query results as CSV files
    ...

Languages

C++93.1%Makefile6.9%

Contributors

Created February 2, 2025
Updated March 27, 2025
NarendraYSF/AST2DB | GitHunt