Oak Julia Parser
High-performance incremental Julia parser for the oak ecosystem with flexible configuration, optimized for scientific computing and data analysis.
🎯 Overview
Oak Julia is a robust parser for Julia, designed to handle complete Julia syntax including modern features. Built on the solid foundation of oak-core, it provides both high-level convenience and detailed AST generation for scientific computing and data analysis.
✨ Features
- Complete Julia Syntax: Supports all Julia features including modern specifications
- Full AST Generation: Generates comprehensive Abstract Syntax Trees
- Lexer Support: Built-in tokenization with proper span information
- Error Recovery: Graceful handling of syntax errors with detailed diagnostics
🚀 Quick Start
Basic example:
use ;
use ;
📋 Parsing Examples
Function Parsing
use ;
use ;
let mut session = default;
let parser = new;
let source = new;
let result = parser.parse;
println!;
Type Parsing
use ;
use ;
let mut session = default;
let parser = new;
let source = new;
let result = parser.parse;
println!;
🔧 Advanced Features
Token-Level Parsing
use ;
use ;
let mut session = default;
let parser = new;
let source = new;
let result = parser.parse;
println!;
Error Handling
use ;
use ;
let mut session = default;
let parser = new;
let source = new;
let result = parser.parse;
if let Some = result.result.err else
🏗️ AST Structure
The parser generates a comprehensive AST with the following main structures:
- JuliaProgram: Root container for Julia programs
- Function: Julia functions and methods
- Struct: Julia struct definitions
- Module: Julia module definitions
- Expression: Various expression types including operators
- Statement: Control flow, loops, conditionals
📊 Performance
- Streaming: Parse large Julia files without loading entirely into memory
- Incremental: Re-parse only changed sections
- Memory Efficient: Smart AST node allocation
- Fast Recovery: Quick error recovery for better IDE integration
🔗 Integration
Oak Julia integrates seamlessly with:
- Scientific Computing: Julia code analysis and optimization
- Data Analysis: Processing and transforming Julia code
- IDE Support: Language server protocol compatibility
- Code Generation: Generating code from Julia AST
- Documentation: Generating documentation from Julia code
📚 Examples
Check out the examples directory for comprehensive examples:
- Complete Julia program parsing
- Function and type analysis
- Code transformation
- Integration with development workflows
🤝 Contributing
Contributions are welcome!
Please feel free to submit pull requests at the project repository or open issues.