macro_rules! for_each_inst {
($callback:ident) => { ... };
}
Expand description
Generates a possible definition for each instruction, it leverages a callback macro that takes (at least) 3 arguments:
- $name: an identifier containing the full defined opcode name, e.g., OP_ADD
- $real_name: an identifier containing just the opcode part, e.g., ADD
- $code: an expr containing the actual opcode number
Free variables are attached to the variants ending with inst1, inst2, etc. Those free variables will also be appended as arguments to the callback macro.