Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Tracker SCM

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/depend/se2dae.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/depend/se2dae.sml

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

revision 904, Mon Aug 20 19:50:05 2001 UTC revision 905, Thu Aug 23 21:53:02 2001 UTC
# Line 6  Line 6 
6   * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)   * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7   *)   *)
8  signature STATENV2DAENV = sig  signature STATENV2DAENV = sig
9      val cvt : Environment.staticEnv -> DAEnv.env * (unit -> SymbolSet.set)      val cvt : StaticEnv.staticEnv -> DAEnv.env * (unit -> SymbolSet.set)
10    
11      (* The thunk passed to cvtMemo will not be called until the first      (* The thunk passed to cvtMemo will not be called until the first
12       * attempt to query the resulting DAEnv.env.       * attempt to query the resulting DAEnv.env.
# Line 14  Line 14 
14       * should further guard the resulting env with an appropriate filter       * should further guard the resulting env with an appropriate filter
15       * to avoid queries that are known in advance to be unsuccessful       * to avoid queries that are known in advance to be unsuccessful
16       * because they would needlessly cause the thunk to be called. *)       * because they would needlessly cause the thunk to be called. *)
17      val cvtMemo : (unit -> Environment.staticEnv) -> DAEnv.env      val cvtMemo : (unit -> StaticEnv.staticEnv) -> DAEnv.env
18  end  end
19    
20  structure Statenv2DAEnv :> STATENV2DAENV = struct  structure Statenv2DAEnv :> STATENV2DAENV = struct
21    
22      structure E = Environment      structure BSE = BrowseStatEnv
23    
24      fun cvt_fctenv look = DAEnv.FCTENV (cvt_result o look)      fun cvt_fctenv look = DAEnv.FCTENV (cvt_result o look)
25    
26      and cvt_result (E.CM_ENV { look, ... }) = SOME (cvt_fctenv look)      and cvt_result (BSE.Env { look, ... }) = SOME (cvt_fctenv look)
27        | cvt_result E.CM_NONE = NONE        | cvt_result BSE.NoEnv = NONE
28    
29      fun cvt sb = let      fun cvt sb = let
30          fun l2s l = let          fun l2s l = let
31              fun addModule (sy, set) =              fun addModule ((sy, _), set) =
32                  case Symbol.nameSpace sy of                  case Symbol.nameSpace sy of
33                      (Symbol.STRspace | Symbol.SIGspace |                      (Symbol.STRspace | Symbol.SIGspace |
34                       Symbol.FCTspace | Symbol.FSIGspace) =>                       Symbol.FCTspace | Symbol.FSIGspace) =>
# Line 37  Line 37 
37          in          in
38              foldl addModule SymbolSet.empty l              foldl addModule SymbolSet.empty l
39          end          end
40          val dae = cvt_fctenv (E.cmEnvOfModule sb)          val dae = cvt_fctenv (BSE.browse sb)
41          fun mkDomain () = l2s (E.catalogEnv sb)          fun mkDomain () = l2s (StaticEnv.sort sb)
42      in      in
43          (dae, mkDomain)          (dae, mkDomain)
44      end      end
# Line 46  Line 46 
46      fun cvtMemo getSB = let      fun cvtMemo getSB = let
47          val l = ref (fn s => raise Fail "se2dae: uninitialized")          val l = ref (fn s => raise Fail "se2dae: uninitialized")
48          fun looker s = let          fun looker s = let
49              fun getCME () = E.cmEnvOfModule (getSB ())              fun getCME () = BSE.browse (getSB ())
50              val lk = cvt_result o (getCME ())              val lk = cvt_result o (getCME ())
51          in          in
52              l := lk;              l := lk;

Legend:
Removed from v.904  
changed lines
  Added in v.905

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