Crate cexpr

Source
Expand description

A C expression parser and evaluator.

This crate provides methods for parsing and evaluating simple C expressions. In general, the crate can handle most arithmetic expressions that would appear in macros or the definition of constants, as well as string and character constants.

The main entry point for is [token::parse], which parses a byte string and returns its evaluated value.

Modules§

  • Evaluating C expressions from tokens.
  • Parsing C literals from byte slices.
  • nom’s result types, re-exported.
  • Representation of a C token

Structs§

  • Parsing errors specific to C parsing.

Enums§

  • Parsing errors specific to C parsing

Functions§

  • If the input result indicates a succesful parse, but there is data left, return an Error::Partial instead.