Parze
Parze is a clean, efficient parser combinator written in Rust.
Example
A parser capable of parsing all valid Brainfuck code into an AST.
use *;
parsers!
Features
- All the usual parser combinator operations
- Macro for simple rule and parser declaration
- Support for recursive parser definitions
- Custom error types - define your own!
- Prioritised / merged failure for more useful errors
- No dependencies - fast compilation!
-
no_std
support
Why Parze?
Parze is fast and lightweight, acting as a bare-bones framework upon which more verbose and interesting parsers can be constructed (see the custom_error
example).
Performance
Here are the results of a JSON parsing test when compared with pom
. More performance metrics to come later.
test parze ... bench: 5,275,399 ns/iter (+/- 653,539)
test pom ... bench: 18,843,978 ns/iter (+/- 2,602,971)
Explicit Form
While Parze encourages use of macros for much of its declarative notation, it is possible (and often useful) to make use of the more explicit rust-y notation.
Here is the Brainfuck parser given above, declared in explicit form.
let bf: = recursive;
License
Parze is distributed under either of:
-
Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
-
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at the disgression of the user.