A Rust parser combinator library for fast, safe binary and text parsers
open sourceMITfree
nom builds parsers in Rust by combining small parsing functions into larger ones, using Rust's strong typing and memory safety to make parsers that are safe without giving up speed or memory use. It handles binary formats, text formats, programming languages and streaming input such as network formats and huge files.
Problems it solves
- write a parser for a binary file format in Rust
- parse a custom text format or small language in Rust without a parser generator
- parse network protocol messages that arrive in chunks in Rust
Features
- Parser combinators as functions, macros and traits
- Binary and text format parsing
- Streaming parsers for network formats and huge files
- Programming language parsers
- Zero-copy: returns slices of the input
- no_std builds, with or without an allocator
Alternatives
The same job
These do what nom does.
- Pest The elegant PHP testing framework
- NimbleParsec A simple and fast library for text-based parser combinators
- pest (Rust) The elegant PEG parser generator for Rust
- peg Packrat parser generator for Go from Parsing Expression Grammars
