Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/stable/stabilize.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/stable/stabilize.sml

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

revision 308, Wed Jun 2 01:26:19 1999 UTC revision 309, Wed Jun 2 03:21:57 1999 UTC
# Line 1  Line 1 
1  structure Stablize = struct  (*
2     * Reading, generating, and writing stable groups.
3     *
4     * (C) 1999 Lucent Technologies, Bell Laboratories
5     *
6     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7     *)
8    local
9      structure DG = DependencyGraph      structure DG = DependencyGraph
10      structure GG = GroupGraph      structure GG = GroupGraph
11      structure EM = GenericVC.ErrorMsg      structure EM = GenericVC.ErrorMsg
12        structure GP = GeneralParams
13        structure E = GenericVC.Environment
14    in
15    
16    signature STABILIZE = sig
17    
18        val loadStable :
19            GP.info * (AbsPath.t -> GG.group) ->
20            { group: AbsPath.t, s: BinIO.instream, anyerrors: bool ref } ->
21            GG.group option
22    
23        val stabilize :
24            GP.info ->
25            { group: GG.group, s: BinIO.outstream, anyerrors: bool ref } ->
26            GG.group
27    end
28    
29    functor StablizeFn
30        (val bn2statenv : GP.info -> DG.bnode -> E.staticEnv
31         val binSizeOf : SmlInfo.info -> int
32         val copyBin : BinIO.outstream -> SmlInfo.info -> unit) :> STABILIZE =
33    struct
34    
35    
36      datatype pitem =      datatype pitem =
37          PSS of SymbolSet.set          PSS of SymbolSet.set
# Line 48  Line 77 
77          SymbolMap.foldl add IntBinaryMap.empty exports          SymbolMap.foldl add IntBinaryMap.empty exports
78      end      end
79    
80      fun stabilize gp (g as GG.GROUP grec, binSizeOf, copyBin, outs) =      fun stabilize gp { group = g as GG.GROUP grec, s = outs, anyerrors } =
81          case #stableinfo grec of          case #stableinfo grec of
82              GG.STABLE _ => g              GG.STABLE _ => g
83            | GG.NONSTABLE granted => let            | GG.NONSTABLE granted => let
84    
85                  (* this needs to be refined (perhaps) *)                  val grpSrcInfo = (#errcons gp, anyerrors)
                 val grpSrcInfo = (EM.defaultConsumer (), ref false)  
86    
87                  val exports = #exports grec                  val exports = #exports grec
88                  val islib = #islib grec                  val islib = #islib grec
# Line 281  Line 309 
309                  mkStableGroup ()                  mkStableGroup ()
310              end              end
311    
312      fun g (getGroup, bn2env, group, s) = let      fun loadStable (gp, getGroup) { group, s, anyerrors } = let
313    
314          (* we don't care about errors... (?) *)          val bn2env = #1 o Statenv2DAEnv.cvt o bn2statenv gp
315          val grpSrcInfo = (EM.defaultConsumer (), ref false)  
316            val grpSrcInfo = (#errcons gp, anyerrors)
317    
318          exception Format          exception Format
319    
# Line 509  Line 538 
538          SOME (unpickle_group ()) handle Format => NONE          SOME (unpickle_group ()) handle Format => NONE
539      end      end
540  end  end
541    
542    end (* local *)

Legend:
Removed from v.308  
changed lines
  Added in v.309

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