Skip to content

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.

Notifications You must be signed in to change notification settings

NarendraYSF/AST2DB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ...

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published