Oak DOT Language Parser
High-performance incremental DOT parser for the oak ecosystem with flexible configuration, optimized for graph description and visualization.
🎯 Overview
Oak DOT is a robust parser for the DOT graph description language, designed to handle complete DOT syntax including modern features. Built on the solid foundation of oak-core, it provides both high-level convenience and detailed AST generation for graph analysis and visualization.
✨ Features
- Complete DOT Syntax: Supports all DOT 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 ;
📋 Parsing Examples
Graph Parsing
use ;
let parser = new;
let source = new;
let result = parser.parse;
println!;
Digraph Parsing
use ;
let parser = new;
let source = new;
let result = parser.parse;
println!;
🔧 Advanced Features
Token-Level Parsing
use ;
let parser = new;
let source = new;
let result = parser.parse;
// Token information is available in the parse result
Error Handling
use ;
let parser = new;
let source = new;
let result = parser.parse;
if let Err = result.result
🏗️ AST Structure
The parser generates a comprehensive AST with the following main structures:
- Graph: Root container for undirected graphs
- Digraph: Root container for directed graphs
- Node: Node definitions with attributes
- Edge: Edge definitions with attributes
- Subgraph: Nested graph structures
- Attribute: Key-value attribute pairs
📊 Performance
- Streaming: Parse large DOT 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 of dot integrates seamlessly with:
- Graph Visualization: Parse DOT files for rendering
- Graph Analysis: Analyze graph structures for properties and patterns
- Code Generation: Generate DOT files from other data structures
- IDE Support: Language server protocol compatibility for DOT
- Documentation: Generate documentation from graph definitions
📚 Examples
Check out the examples directory for comprehensive examples:
- Complete DOT graph parsing
- Node and edge analysis
- Attribute processing
- Integration with development workflows
🤝 Contributing
Contributions are welcome!
Please feel free to submit pull requests at the project repository or open issues.