Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narendraysf/ast2db
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.
https://github.com/narendraysf/ast2db
c cpp sqlite
Last synced: 18 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/narendraysf/ast2db
- Owner: NarendraYSF
- Created: 2025-02-02T08:13:07.000Z (19 days ago)
- Default Branch: main
- Last Pushed: 2025-02-02T08:15:19.000Z (19 days ago)
- Last Synced: 2025-02-02T09:22:04.329Z (19 days ago)
- Topics: c, cpp, sqlite
- Language: C++
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Code2SQL
Code2SQL uses `clang` to parse C/C++ code and stores AST node information into an SQLite database.
## Dependencies
- [clang](https://clang.llvm.org/)## 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
```bash
$ make # Compile
$ make help # View help information
$ ./build/demo # Run
```### Example
Using `./tests/slight.cc` as the target file for testing:
```bash
$ ./build/demo ./tests/slight.cc
```## Features
- [ ] Parse C/C++ code
- [x] Record variable declaration & reference nodes
- [x] Record function declaration & call nodes
...
- [ ] Store AST node information in an SQLite database
- [ ] Support exporting query results as CSV files
...