Skip to main content

generate_code

Function generate_code 

Source
pub fn generate_code(
    def: &ValidatedDef,
    tree: &DecodeNode,
    type_maps: &HashMap<String, String>,
    dispatch_overrides: &HashMap<String, Dispatch>,
) -> String
Expand description

Generate Rust source code from a validated definition and dispatch tree.

The output includes:

  • An enum with all instruction variants
  • A decode() function using efficient match statements
  • Proper type conversions and bit extraction