[][src]Module dark_vm::vm

The VM module. This maintains most of the code for the behavior of different instructions and the behavior of the VM in general. The VM struct represents the VM state after any given changes. This struct maintains the code that is given and the stack. This struct also should not change that much. The only changes would be additions to value enum and evaluate_value function.

The VM can be invoked after the lexer has been run.

Example

let contents = "push 1";
let tokens = Lexer::new().lex(contents)?;
let result = VM::new(tokens).run()?;

Structs

VM