From 0647f37eebbefb8446fc8abfc533a23952fbb8be Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 29 Apr 2018 20:24:38 +0200 Subject: Move sources to dedicated directory --- main.ml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 main.ml (limited to 'main.ml') diff --git a/main.ml b/main.ml deleted file mode 100644 index 2f8d57c..0000000 --- a/main.ml +++ /dev/null @@ -1,30 +0,0 @@ -(* - * UPEM / L3 / Functional programming / Project: URM - * Pacien TRAN-GIRARD, Adam NAILI - *) - -open Common -open Parser -open Instptr -open Reg -open Urm - -let exec_with_resource func filename = - let file = open_in filename in - let res = func file in - close_in file; res - -let read_prgm = exec_with_resource (fun f -> string_of_file f |> program_of_string) -let read_regs = exec_with_resource (fun f -> string_of_file f |> regs_of_string) -let run run_func prgm regs = urm_mk prgm regs |> run_func |> regs_string |> print_endline - -let run_mode_of_string = function - | "run" -> urm_run - | "trace" -> urm_run_trace - | _ -> failwith "Invalid run mode" - -let () = match Sys.argv with - | [| _; "run-tests" |] -> () (* handled in test files *) - | [| _; mode; prgm; regs |] -> run (run_mode_of_string mode) (read_prgm prgm) (read_regs regs) - | _ -> print_endline "Usage: urm | trace >" - -- cgit v1.2.3