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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/global-env/global-env.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/global-env/global-env.sml

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

revision 4042, Fri Jun 24 19:04:21 2016 UTC revision 4043, Sun Jun 26 14:00:38 2016 UTC
# Line 30  Line 30 
30    (* lookup a global variable *)    (* lookup a global variable *)
31      val findVar : t * Atom.atom -> AST.var option      val findVar : t * Atom.atom -> AST.var option
32    
33      (* lookup a kernel *)
34        val findKernel : t * Atom.atom -> Kernel.t option
35    
36    (* add the strand to the environment; this function returns the strand    (* add the strand to the environment; this function returns the strand
37     * environment that we use to track strand state variables.     * environment that we use to track strand state variables.
38     *)     *)
# Line 41  Line 44 
44    (* insert a global variable binding *)    (* insert a global variable binding *)
45      val insertVar : t * Atom.atom * AST.var -> unit      val insertVar : t * Atom.atom * AST.var -> unit
46    
47      (* insert a kernel binding*)
48        val insertKernel : t * Atom.atom * Kernel.t -> unit
49    
50    (* tracking program features *)    (* tracking program features *)
51      val recordProp : t * Properties.t -> unit      val recordProp : t * Properties.t -> unit
52      val properties : t -> Properties.t list      val properties : t -> Properties.t list
# Line 60  Line 66 
66          strand : StrandEnv.t option ref,        (* the strand *)          strand : StrandEnv.t option ref,        (* the strand *)
67          fEnv : fun_def ATbl.hash_table,         (* functions, which may be overloaded *)          fEnv : fun_def ATbl.hash_table,         (* functions, which may be overloaded *)
68          vEnv : AST.var ATbl.hash_table,         (* global variable bindings *)          vEnv : AST.var ATbl.hash_table,         (* global variable bindings *)
69            kEnv : Kernel.t ATbl.hash_table,        (* kernel bindings *)
70          props : Properties.t list ref           (* record program properties *)          props : Properties.t list ref           (* record program properties *)
71        }        }
72    
# Line 67  Line 74 
74              strand = ref NONE,              strand = ref NONE,
75              fEnv = ATbl.mkTable(128, Fail "global function env"),              fEnv = ATbl.mkTable(128, Fail "global function env"),
76              vEnv = ATbl.mkTable(128, Fail "global variable env"),              vEnv = ATbl.mkTable(128, Fail "global variable env"),
77                kEnv = ATbl.mkTable(16, Fail "kernel env"),
78              props = ref[]              props = ref[]
79            }            }
80    
# Line 82  Line 90 
90    
91      fun insertVar (GE{vEnv, ...}, x, x') = ATbl.insert vEnv (x, x')      fun insertVar (GE{vEnv, ...}, x, x') = ATbl.insert vEnv (x, x')
92    
93        fun insertKernel (GE{kEnv, ...}, k, k') = ATbl.insert kEnv (k, k')
94    
95    (* lookup a strand *)    (* lookup a strand *)
96      fun findStrand (GE{strand, ...}, name) = (case !strand      fun findStrand (GE{strand, ...}, name) = (case !strand
97             of NONE => NONE             of NONE => NONE
# Line 97  Line 107 
107    
108      fun findVar (GE{vEnv, ...}, x) = ATbl.find vEnv x      fun findVar (GE{vEnv, ...}, x) = ATbl.find vEnv x
109    
110        fun findKernel (GE{kEnv, ...}, x) = ATbl.find kEnv x
111    
112    (* tracking program features *)    (* tracking program features *)
113      fun recordProp (GE{props, ...}, p) = if (Properties.hasProp p (!props))      fun recordProp (GE{props, ...}, p) = if (Properties.hasProp p (!props))
114            then ()            then ()

Legend:
Removed from v.4042  
changed lines
  Added in v.4043

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