Merge remote-tracking branch 'origin/hw2'

* origin/hw2:
  Fixed common.ml/Syntax.ml
  Fixed common.mlyet again
  Fixed SM.run
  Added SM.run
  Fixed common.ml
  Sync
  Added CONST instruction
This commit is contained in:
Podkopaev Anton 2018-03-06 17:58:54 +03:00
commit 29cd925266
4 changed files with 281 additions and 7 deletions

View file

@ -28,11 +28,11 @@ let eval _ = failwith "Not yet implemented"
(* Top-level evaluation
val run : prg -> int list -> int list
val run : int list -> prg -> int list
Takes an input stream, a program, and returns an output stream this program calculates
*)
let run p i = let (_, (_, _, o)) = eval ([], (Expr.empty, i, [])) p in o
let run i p = let (_, (_, _, o)) = eval ([], (Syntax.Expr.empty, i, [])) p in o
(* Stack machine compiler