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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/env/env.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/env/env.sml

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

revision 752, Thu Apr 7 14:47:45 2011 UTC revision 753, Thu Apr 7 14:48:23 2011 UTC
# Line 10  Line 10 
10    
11      val new : unit -> env      val new : unit -> env
12    
13      val findFunc : env * Atom.atom -> AST.var option      val findFunc : env * Atom.atom -> AST.var list
14    
15      val findVar : env * Atom.atom -> AST.var option      val findVar : env * Atom.atom -> AST.var option
16    
17    (* insert a function binding *)    (* insert a function binding *)
18      val insertFunc : env * Atom.atom * AST.var -> env      val insertFunc : env * Atom.atom * AST.var list -> env
19    
20    (* insert variable bindings *)    (* insert variable bindings *)
21      val insertGlobal : env * Atom.atom * AST.var -> env      val insertGlobal : env * Atom.atom * AST.var -> env
# Line 28  Line 28 
28    
29    (* global environment holds global variables and strands *)    (* global environment holds global variables and strands *)
30      datatype global_env = GE of {      datatype global_env = GE of {
31          fEnv : AST.var ATbl.hash_table,         (* functions *)          fEnv : AST.var list ATbl.hash_table,    (* functions, which may be overloaded *)
32          vEnv : AST.var ATbl.hash_table          (* global variable bindings *)          vEnv : AST.var ATbl.hash_table          (* global variable bindings *)
33        }        }
34    
# Line 45  Line 45 
45              vEnv = AMap.empty              vEnv = AMap.empty
46            }            }
47    
48      fun findFunc (E{g=GE{fEnv, ...}, ...}, x) = ATbl.find fEnv x      fun findFunc (E{g=GE{fEnv, ...}, ...}, x) = (case ATbl.find fEnv x
49               of NONE => []
50                | SOME fns => fns
51              (* end case *))
52    
53      fun findVar (E{g=GE{vEnv=gvEnv, ...}, vEnv}, x) = (case AMap.find(vEnv, x)      fun findVar (E{g=GE{vEnv=gvEnv, ...}, vEnv}, x) = (case AMap.find(vEnv, x)
54             of NONE => ATbl.find gvEnv x             of NONE => ATbl.find gvEnv x

Legend:
Removed from v.752  
changed lines
  Added in v.753

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