Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/lamont_dev/src/compiler/IL/check-il-fn.sml
ViewVC logotype

Diff of /branches/lamont_dev/src/compiler/IL/check-il-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 412, Sat Oct 16 15:19:19 2010 UTC revision 414, Sat Oct 16 18:00:43 2010 UTC
# Line 31  Line 31 
31    
32    ) : sig    ) : sig
33    
34      (* check the program for type errors, etc.  The first argument will be used to
35       * identify the phase that the check follows and the return result will be true
36       * if any errors were detected.
37       *)
38        val check : string * IL.program -> bool
39    
40    end = struct    end = struct
41    
42      structure IL = IL      structure IL = IL
# Line 41  Line 47 
47      datatype token      datatype token
48        = NL | S of string | V of IL.var | VTYS of IL.var list | TY of Ty.ty | TYS of Ty.ty list        = NL | S of string | V of IL.var | VTYS of IL.var list | TY of Ty.ty | TYS of Ty.ty list
49    
50      fun err errBuf toks = let      fun error errBuf toks = let
51            fun tok2str NL = "\n  ** "            fun tok2str NL = "\n  ** "
52              | tok2str (S s) = s              | tok2str (S s) = s
53              | tok2str (V x) = V.toString x              | tok2str (V x) = V.toString x
# Line 140  Line 146 
146                  ]                  ]
147            end            end
148    
149        fun check (phase, IL.Program{globals, globalInit, actors}) = let
150              val errBuf = ref []
151              val errFn = error errBuf
152              fun final () = (case !errBuf
153                     of [] => false
154                      | errs => (
155                          Log.msg(concat["********** IL Errors detected after ", phase, " **********\n"]);
156                          List.app (fn msg => Log.msg(msg ^ "\n")) (List.rev errs);
157                          true)
158                    (* end case *))
159              in
160    (* FIXME: check the program *)
161                final()
162              end
163    
164    end    end

Legend:
Removed from v.412  
changed lines
  Added in v.414

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0