Thrift Parser
A high-performance Apache Thrift IDL parser written in Rust that converts Thrift IDL files to JSON AST.
Features
- 🚀 Fast and efficient parsing
- 🎯 Complete Thrift IDL support
- 🔄 JSON AST output
- 📝 Comment preservation
- 🎨 Detailed source location tracking
- ⚡ Parallel processing support
- 📊 Built-in benchmarking
Installation
Usage
Basic Parsing
use Parser;
Supported Thrift Features
- Base types (i32, i64, string, etc.)
- Collections (list, set, map)
- Structs and Exceptions
- Services and Functions
- Enums
- Constants
- Typedefs
- Namespaces
- Includes
- Comments and Annotations
Development
Building
Running Tests
Code Structure
- Lexer: Tokenizes input using Logos
- Parser: Recursive descent parser
- AST: Strongly typed syntax tree
- Location Tracking: Preserves source positions
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.