mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 14:58:50 +00:00
Added SM.run
This commit is contained in:
parent
f3bc389b62
commit
ec08b955af
1 changed files with 8 additions and 0 deletions
|
|
@ -25,6 +25,14 @@ type config = int list * Syntax.Stmt.config
|
||||||
*)
|
*)
|
||||||
let eval _ = failwith "Not yet implemented"
|
let eval _ = failwith "Not yet implemented"
|
||||||
|
|
||||||
|
(* Top-level evaluation
|
||||||
|
|
||||||
|
val run : prg -> int list -> int list
|
||||||
|
|
||||||
|
Takes an input stream, a program, and returns an output stream this program calculates
|
||||||
|
*)
|
||||||
|
let run i p = let (_, (_, _, o)) = eval ([], (Syntax.Expr.empty, i, [])) p in o
|
||||||
|
|
||||||
(* Stack machine compiler
|
(* Stack machine compiler
|
||||||
|
|
||||||
val compile : Syntax.Stmt.t -> prg
|
val compile : Syntax.Stmt.t -> prg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue