Skip to main content

Crate decy_hir

Crate decy_hir 

Source
Expand description

High-level Intermediate Representation for C-to-Rust transpilation.

The HIR is a Rust-oriented representation that bridges C AST and Rust code generation.

§Examples

use decy_hir::{HirFunction, HirType, HirParameter};

// Create a simple HIR function
let func = HirFunction::new(
    "main".to_string(),
    HirType::Int,
    vec![],
);

assert_eq!(func.name(), "main");
assert_eq!(func.return_type(), &HirType::Int);

Structs§

HirConstant
Represents a constant declaration in HIR (from C #define or const).
HirEnum
Represents an enum definition in HIR.
HirEnumVariant
Represents an enum variant in HIR.
HirFunction
Represents a function in HIR.
HirMacroDefinition
Represents a C macro definition in HIR.
HirParameter
Represents a function parameter in HIR.
HirStruct
Represents a struct definition in HIR.
HirStructField
Represents a struct field in HIR.
HirTypedef
Represents a typedef (type alias) in HIR.
SwitchCase
Represents a single case in a switch statement.

Enums§

BinaryOperator
Binary operators for expressions.
HirExpression
Represents an expression in HIR.
HirStatement
Represents a statement in HIR.
HirType
Represents a C type in HIR.
UnaryOperator
Unary operators for expressions.