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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/typechecker/typechecker.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/typechecker/typechecker.sml

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

revision 3409, Wed Nov 11 22:38:14 2015 UTC revision 3410, Thu Nov 12 02:57:49 2015 UTC
# Line 8  Line 8 
8    
9  structure Typechecker : sig  structure Typechecker : sig
10    
11      (* type check a Diderot program *)
12      val check : Error.err_stream -> ParseTree.program -> AST.program      val check : Error.err_stream -> ParseTree.program -> AST.program
13    
14    end = struct    end = struct
15    
16      structure PT = ParseTree      structure PT = ParseTree
17        structure E = Env
18    
19      fun check errStrm (PT.Program{span, tree}) = let      fun check errStrm (PT.Program{span, tree}) = let
20            val {globals, strand, init, create, update} = tree            val {globals, strand, init, create, update} = tree
21            val cxt = (errStrm, span)            val cxt = (errStrm, span)
22            val env = Basis.env()            val env = E.new()
23            val {const_dcls, input_dcls, other_dcls, env} =            val {const_dcls, input_dcls, other_dcls, env} =
24                  CheckGlobals.check (env, cxt, globals)                  CheckGlobals.check (env, cxt, globals)
25  (* FIXME *)            val init' = (case update
26                     of SOME stm => SOME(CheckStmt.check(E.initScope env, cxt, stm))
27                      | NONE => NONE
28                    (* end case *))
29              val (strand', env) = CheckStrand.check (env, cxt, strand)
30              val create' = CheckCreate.check (env, cxt, create)
31            val update' = (case update            val update' = (case update
32                   of SOME stm => SOME(CheckStmt.check(env, cxt, stm))                   of SOME stm => SOME(CheckStmt.check(E.updateScope env, cxt, stm))
33                    | NONE => NONE                    | NONE => NONE
34                  (* end case *))                  (* end case *))
35            in            in
36              AST.Program{              AST.Program{
37                  props = Env.properties env,                  props = E.properties env,
                 globals = globals',  
38                  const_dcls = const_dcls,                  const_dcls = const_dcls,
39                  input_dcls = input_dcls,                  input_dcls = input_dcls,
40                  globals = other_dcls,                  globals = other_dcls,
# Line 37  Line 43 
43                  create = create',                  create = create',
44                  update = update'                  update = update'
45                }                }
46    (* TODO: uninitialized and unused variable check *)
47            end            end
48    
49    end    end

Legend:
Removed from v.3409  
changed lines
  Added in v.3410

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