Crate rustixml

Crate rustixml 

Source
Expand description

rustixml - Native iXML Parser

A pure Rust implementation of the Invisible XML (iXML) specification. Works natively in Rust and compiles to WebAssembly for browser use.

ยงQuick Start

use rustixml::{parse_ixml_grammar, NativeParser};

let grammar = r#"
    greeting: "Hello, ", name, "!".
    name: letter+.
    letter: ["A"-"Z"; "a"-"z"].
"#;

let ast = parse_ixml_grammar(grammar).expect("Invalid grammar");
let parser = NativeParser::new(ast);

let xml = parser.parse("Hello, World!").expect("Parse failed");
println!("{}", xml);

ยงFeatures

  • ๐Ÿš€ Fast native recursive descent parser
  • โœ… 75.4% conformance with iXML specification (49/65 tests)
  • ๐ŸŒ WebAssembly support for browser use
  • ๐Ÿ“ฆ Single dependency (unicode-general-category)
  • ๐Ÿ”’ Pure safe Rust

Re-exportsยง

pub use ast::IxmlGrammar;
pub use grammar_ast::parse_ixml_grammar;
pub use native_parser::NativeParser;
pub use parse_context::ParseContext;
pub use parse_context::ParseError;
pub use parse_context::ParseResult;

Modulesยง

ast
AST (Abstract Syntax Tree) for iXML grammars
charclass
Character class handling for iXML parser
grammar_analysis
Grammar Analysis
grammar_ast
Token-based iXML grammar parser that produces AST
grammar_parser
Handwritten recursive descent parser for iXML grammars
input_stream
Input stream with position tracking and backtracking support
lexer
Lexer for iXML grammar syntax
native_parser
Native iXML interpreter - direct implementation of iXML specification
normalize
Grammar Normalization
parse_context
Parse context and result types for native interpreter
xml_node
XML node representation for parse results