Oak ActionScript Parser
High-performance incremental ActionScript parser for the oak ecosystem with flexible configuration, optimized for Adobe Flash and Apache Flex development.
🎯 Overview
Oak ActionScript is a robust parser for ActionScript 3.0, designed to handle both legacy Flash and modern Flex applications. Built on the solid foundation of oak-core, it provides both high-level convenience and detailed AST generation for ActionScript analysis and tooling.
✨ Features
- Complete AS3 Syntax: Supports all ActionScript 3.0 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
Class Parsing
use ;
let parser = new;
let source = new;
let result = parser.parse;
println!;
Function 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:
- Package: ActionScript package declarations
- ClassDefinition: Class definitions with inheritance
- FunctionDefinition: Function and method definitions
- VariableDeclaration: Variable declarations with type annotations
- Expression: Expressions including arithmetic, logical, and function calls
- Statement: Control flow statements and assignments
- TypeAnnotation: Type specifications and annotations
📊 Performance
- Streaming: Parse large ActionScript 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 actionscript integrates seamlessly with:
- Flash Development: Build Flash applications and games
- Code Analysis: Static analysis and refactoring tools
- IDE Support: Language server protocol compatibility for ActionScript
- Migration Tools: Convert ActionScript to other languages
- Educational Tools: Build programming language learning environments
📚 Examples
Check out the examples directory for comprehensive examples:
- Complete ActionScript class parsing
- Flash API integration
- Event handling and animation
- Integration with development workflows
🤝 Contributing
Contributions are welcome!
Please feel free to submit pull requests at the project repository or open issues.