diff src/compiler.sig @ 201:f2cac0dba9bf

Consolidating compiler phase interface and adding timing
author Adam Chlipala <adamc@hcoop.net>
date Tue, 12 Aug 2008 14:40:07 -0400
parents 8a70e2919e86
children af5bd54cbbd7
line wrap: on
line diff
--- a/src/compiler.sig	Sat Aug 09 20:08:29 2008 -0400
+++ b/src/compiler.sig	Tue Aug 12 14:40:07 2008 -0400
@@ -30,47 +30,31 @@
 signature COMPILER = sig
 
     type job = string list
-    val compile : job -> unit
+    (*val compile : job -> unit*)
     val compileC : {cname : string, oname : string, ename : string} -> unit
 
-    val parseLig : string -> Source.sgn_item list option
-    val testLig : string -> unit
+    type ('src, 'dst) phase
+    type ('src, 'dst) transform
 
-    val parseLac : string -> Source.file option
-    val testLac : string -> unit
+    val transform : ('src, 'dst) phase -> string -> ('src, 'dst) transform
+    val o : ('a, 'b) transform * ('b, 'c) transform -> ('a, 'c) transform
 
-    val parse : job -> Source.file option
-    val elaborate : job -> Elab.file option
-    val explify : job -> Expl.file option
-    val corify : job -> Core.file option
-    val shake' : job -> Core.file option
-    val tag : job -> Core.file option
-    val reduce : job -> Core.file option
-    val specialize : job -> Core.file option
-    val shake : job -> Core.file option
-    val monoize : job -> Mono.file option
-    val mono_opt' : job -> Mono.file option
-    val untangle : job -> Mono.file option
-    val mono_reduce : job -> Mono.file option
-    val mono_shake : job -> Mono.file option
-    val mono_opt : job -> Mono.file option
-    val cjrize : job -> Cjr.file option
+    val run : ('src, 'dst) transform -> 'src -> 'dst option
+    val runPrint : ('src, 'dst) transform -> 'src -> unit
+    val time : ('src, 'dst) transform -> 'src -> unit
+    val timePrint : ('src, 'dst) transform -> 'src -> unit
 
-    val testParse : job -> unit
-    val testElaborate : job -> unit
-    val testExplify : job -> unit
-    val testCorify : job -> unit
-    val testShake' : job -> unit
-    val testTag : job -> unit
-    val testReduce : job -> unit
-    val testSpecialize : job -> unit
-    val testShake : job -> unit
-    val testMonoize : job -> unit
-    val testMono_opt' : job -> unit
-    val testUntangle : job -> unit
-    val testMono_reduce : job -> unit
-    val testMono_shake : job -> unit
-    val testMono_opt : job -> unit
-    val testCjrize : job -> unit
+    val parseLac : (string, Source.file) phase
+    val parseLig : (string, Source.sgn_item list) phase
+
+    val parse : (job, Source.file) phase
+    val elaborate : (Source.file, Elab.file) phase
+    val explify : (Elab.file, Expl.file) phase
+    val corify : (Expl.file, Core.file) phase
+
+    val toParse : (job, Source.file) transform
+    val toElaborate : (job, Elab.file) transform
+    val toExplify : (job, Expl.file) transform
+    val toCorify : (job, Core.file) transform    
 
 end