StackWalk is a library for parsing and indexing code in various languages. 📚
- Extract code structure and call information 📊
- Generate call graphs 🌐
- Support for multiple languages 🌍
- Rust 🦀
- Python 🐍
- Configurable language-specific settings 🛠️
Add stackwalk as a dependency in your Cargo.toml file:
[dependencies] stackwalk = "0.1.0"
use stackwalk::config::Config; use stackwalk::indexer::index_directory; fn main() { let toml_str = fs::read_to_string("stackwalk.toml").expect("Unable to read file"); let config = Config::from_toml(&toml_str).unwrap(); let dir_path = "path/to/directory"; let (blocks, call_stack, call_graph) = index_directory(&config, dir_path); // Process the extracted information // ... }
StackWalk uses a TOML configuration file to specify language-specific settings. Here's an example configuration:
[languages] [languages.python] [languages.python.matchers] import_statement = "import_from_statement" # ... [languages.rust] [languages.rust.matchers] import_statement = "use_declaration" # ...
To build the project from source:
$ git clone https://github.com/stitionai/stackwalk.git
$ cd stackwalk/
$ cargo build --releaseWays to contribute:
- Suggest a feature
- Report a bug
- Fix something and open a pull request
- Help document the code
- Spread the word
Licensed under the MIT License, see LICENSE for more information.
Support the project by starring the repository. ⭐
