nom is a parser combinator framework for Rust used to build complex parsers by combining small, reusable parsing functions. It functions as a zero-copy parsing tool that minimizes memory overhead by returning slices of the original input instead of allocating new memory.
The framework is designed for diverse data formats, serving as a binary data parser with configurable endianness and a bitstream processing library capable of extracting values of arbitrary bit length. It also functions as a streaming data parser that can process data arriving in chunks and signal when additional input is required to complete a result.
Its capabilities cover a wide range of parsing domains, including the construction of abstract syntax trees for programming languages, the processing of structured text and escaped characters, and the extraction of length-prefixed or delimited binary data. The system includes higher-order primitives for sequencing, branching, and repeating parsing logic, as well as tools for operator precedence handling and input pattern validation.
The library provides descriptive error generation to pinpoint the exact location of parsing failures through error codes and input pointers.