Struct stack_vm::InstructionTable
[−]
[src]
pub struct InstructionTable<T: Debug>(_);
The instruction table.
Implemented as a HashMap
behind the scenes.
Methods
impl<T: Debug> InstructionTable<T>
[src]
fn new() -> InstructionTable<T>
[src]
Create a new empty instruction table.
fn by_op_code(&self, op_code: usize) -> Option<&Instruction<T>>
[src]
Retrieve an instruction by looking up it's op code.
fn by_name(&self, name: &str) -> Option<&Instruction<T>>
[src]
Retrieve an instruction by looking up it's name.
fn insert(&mut self, instr: Instruction<T>)
[src]
Insert an instruction into the table.
fn is_empty(&self) -> bool
[src]
Returns true
if the instruction table is empty.
fn symbols(&self) -> Vec<(usize, String)>
[src]
Returns a list of symbols for use in the Code
struct.
Generates a vector of tuples containing the op code and the name of each instruction.