Crate cmacro

Crate cmacro 

Source
Expand description

A library for parsing C macros.

This crate allows parsing C macros and converting them to Rust code.

Both function-like macros (e.g. #define FUNC(a, b, c) a + b * c) as well as variable-like macros (e.g. #define VAR 4 + 7 * 82) are supported.

See FnMacro and VarMacro on how to parse macros.

Re-exports§

pub use ast::*;

Modules§

ast
This module contains all types needed for parsing a macro to an abstract syntax tree.

Structs§

FnMacro
A function-like macro.
VarMacro
A variable-like macro.

Enums§

Error
A parsing or codegen error.
MacroBody
The body of a macro.

Traits§

CodegenContext
Context for code generation.

Functions§

expand
Expand macros.