cexpr

Module expr

Source
Expand description

Evaluating C expressions from tokens.

Numerical operators are supported. All numerical values are treated as i64 or f64. Type casting is not supported. i64 are converted to f64 when used in conjunction with a f64. Right shifts are always arithmetic shifts.

The sizeof operator is not supported.

String concatenation is supported, but width prefixes are ignored; all strings are treated as narrow strings.

Use the IdentifierParser to substitute identifiers found in expressions.

Structs§

Enums§

  • The result of parsing a literal or evaluating an expression.

Functions§

  • Parse and evaluate an expression of a list of tokens.
  • Parse a functional macro declaration from a list of tokens.
  • Parse and evaluate a macro definition from a list of tokens.

Type Aliases§

  • A shorthand for the type of cexpr expression evaluation results.