Oak Javadoc Parser
High-performance incremental Javadoc parser for the oak ecosystem with flexible configuration, optimized for API documentation generation and code analysis.
🎯 Overview
Oak Javadoc is a robust parser for Java documentation comments (Javadoc), designed to handle complete Javadoc syntax including standard tags and custom extensions. Built on the solid foundation of oak-core, it provides both high-level convenience and detailed AST generation for documentation analysis and generation.
✨ Features
- Complete Javadoc Syntax: Supports all standard Javadoc tags and HTML elements
- Custom Tag Support: Handles custom Javadoc tags and extensions
- 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
Class Documentation
use ;
let parser = new;
let source = new;
let result = parser.parse;
println!;
Method Documentation with Examples
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:
- Javadoc: Root container for Javadoc comments
- Description: Main description text with HTML elements
- BlockTag: Block-level tags like @param, @return, @throws
- InlineTag: Inline tags like {@link}, {@code}, {@literal}
- HtmlElement: HTML elements within the documentation
📊 Performance
- Streaming: Parse large Javadoc 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-javadoc integrates seamlessly with:
- Documentation Generation: Generating HTML docs from Javadoc comments
- Static Analysis: Analyzing code quality and documentation coverage
- IDE Support: Language server protocol compatibility for Java
- API Extraction: Extracting API specifications from source code
- Code Completion: Providing context-aware code completion
📚 Examples
Check out the examples directory for comprehensive examples:
- Complete class documentation parsing
- Method and field documentation analysis
- Custom tag handling
- Integration with documentation generation tools
🤝 Contributing
Contributions are welcome!
Please feel free to submit pull requests at the project repository or open issues.