nom, eating data byte by byte
nom is a parser combinator library with a focus on safe parsing, streaming patterns, and as much as possible zero copy.
The code is available on Github
There are a few guides with more details about the design of nom, how to write parsers, or the error management system.
If you are upgrading to nom 2.0, please read the migration document.
See also the FAQ.
Example
extern crate nom;
use ;
// Parser definition
use str;
use FromStr;
// We parse any expr surrounded by parens, ignoring all whitespaces around those
named!;
// We transform an integer string into a i64, ignoring surrounding whitespaces
// We look for a digit suite, and try to convert it.
// If either str::from_utf8 or FromStr::from_str fail,
// we fallback to the parens parser defined above
named!;
// We read an initial factor and for each time we find
// a * or / operator followed by another factor, we do
// the math by folding everything
named!;
named!;