Konarak
b7dee58454
- modify existing implementation to use variant types for a more accurate representation of the vm byte code - switch to fold from recursion for the main translate function - use separate modules for translating different vm commands - move static arithmetic command translations to a map
11 lines
287 B
OCaml
11 lines
287 B
OCaml
open Ast
|
|
|
|
(* Parse a string to the Ast.expr type. *)
|
|
val parse : string -> expr
|
|
|
|
(* Set the Stack Pointer to 256 and call Sys.init function. *)
|
|
val bootstrap : string list
|
|
|
|
(* Translate from parsed byte code [Ast.expr] to assembly *)
|
|
val translate : string -> string list -> string list
|