compiler: modify the Emit module to actually produce a vm_state object directly executable by the VM
This commit is contained in:
@@ -36,4 +36,15 @@ type vm_state = {
|
||||
mutable stack : value list
|
||||
}
|
||||
|
||||
|
||||
let make_vm instrs constants global_count =
|
||||
{
|
||||
i = 0;
|
||||
instrs = instrs;
|
||||
globals = Array.make global_count Nil;
|
||||
constants = constants;
|
||||
env = [];
|
||||
stack = [];
|
||||
}
|
||||
|
||||
(* TODO: add facilities to print the VM state in case of errors. *)
|
||||
|
||||
Reference in New Issue
Block a user