jsxbin-parser 1.0.0

Binary parser for Adobe JSX .jsxbin files with comprehensive AST representation
Documentation

jsxbin-parser

Crates.io Docs License

Binary parser for Adobe JSX .jsxbin files with comprehensive AST representation.

Features

  • Magic Byte Validation: Validates 0x4A 0x58 ("JX") format
  • Version Support: JSXBIN 1.x format parsing
  • String Table Extraction: Deduplicates identifier strings
  • 20+ Token Types: Complete AST with semantic tokens
  • Error Recovery: Graceful handling of malformed input
  • No unsafe: 100% safe Rust

Quick Start

use jsxbin_parser::JsxbinParser;

// Read binary file
let data = std::fs::read("script.jsxbin")?;

// Parse
let mut parser = JsxbinParser::new(data);
let file = parser.parse()?;

// Access tokens
for token in &file.tokens {
    println!("{:?}", token);
}

Token Types

The parser recognizes 20+ token types:

Token::Function { name, params, body }
Token::IfStatement { condition, consequent, alternate }
Token::BinaryOperation { left, operator, right }
Token::StringLiteral(String)
Token::NumberLiteral(f64)
Token::Identifier(String)
// ... and more

Performance

  • 100 KB file: ~25ms
  • 1 MB file: ~150ms
  • 10 MB file: ~1.2s

Linear O(n) complexity.

Examples

See examples/parse_file.rs for complete working example.

cargo run --example parse_file -- script.jsxbin

Contributing

Contributions welcome! See CONTRIBUTING.md.

License

Licensed under the MIT License. See LICENSE file.

Related