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.
- HirEnum
Variant - Represents an enum variant in HIR.
- HirFunction
- Represents a function in HIR.
- HirMacro
Definition - Represents a C macro definition in HIR.
- HirParameter
- Represents a function parameter in HIR.
- HirStruct
- Represents a struct definition in HIR.
- HirStruct
Field - Represents a struct field in HIR.
- HirTypedef
- Represents a typedef (type alias) in HIR.
- Switch
Case - Represents a single case in a switch statement.
Enums§
- Binary
Operator - Binary operators for expressions.
- HirExpression
- Represents an expression in HIR.
- HirStatement
- Represents a statement in HIR.
- HirType
- Represents a C type in HIR.
- Unary
Operator - Unary operators for expressions.