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/depend/reachable.sml
ViewVC logotype

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

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

revision 451, Sat Oct 23 15:05:55 1999 UTC revision 492, Fri Nov 26 09:00:50 1999 UTC
# Line 9  Line 9 
9      val reachable' : DependencyGraph.impexp SymbolMap.map -> SrcPathSet.set      val reachable' : DependencyGraph.impexp SymbolMap.map -> SrcPathSet.set
10      val reachable : GroupGraph.group -> SrcPathSet.set      val reachable : GroupGraph.group -> SrcPathSet.set
11      val snodeMap : GroupGraph.group -> DependencyGraph.snode SrcPathMap.map      val snodeMap : GroupGraph.group -> DependencyGraph.snode SrcPathMap.map
12        val groupsOf : GroupGraph.group -> SrcPathSet.set
13  end  end
14    
15  structure Reachable :> REACHABLE = struct  structure Reachable :> REACHABLE = struct
16      structure DG = DependencyGraph      structure DG = DependencyGraph
17        structure GG = GroupGraph
18    
19      local      local
20          fun reach ops (exports: DG.impexp SymbolMap.map) = let          fun reach ops (exports: DG.impexp SymbolMap.map) = let
# Line 45  Line 47 
47                      member = SrcPathSet.member,                      member = SrcPathSet.member,
48                      empty = SrcPathSet.empty }                      empty = SrcPathSet.empty }
49    
50          fun reachable (GroupGraph.GROUP { exports, ... }) = reachable' exports          fun reachable (GG.GROUP { exports, ... }) = reachable' exports
51    
52          fun snodeMap g = let          fun snodeMap g = let
53              fun snm (g, (a, seen)) = let              fun snm (g, (a, seen)) = let
54                  val GroupGraph.GROUP { exports, sublibs, grouppath, ... } = g                  val GG.GROUP { exports, sublibs, grouppath, ... } = g
55              in              in
56                  if SrcPathSet.member (seen, grouppath) then (a, seen)                  if SrcPathSet.member (seen, grouppath) then (a, seen)
57                  else foldl (fn ((_, g), x) => snm (g, x))                  else foldl (fn ((_, g), x) => snm (g, x))
# Line 60  Line 62 
62          in          in
63              #1 (snm (g, (SrcPathMap.empty, SrcPathSet.empty)))              #1 (snm (g, (SrcPathMap.empty, SrcPathSet.empty)))
64          end          end
65    
66            fun groupsOf g = let
67                fun go (GG.GROUP { grouppath, sublibs, ... }, a) = let
68                    fun sl ((p, g as GG.GROUP { kind = GG.NOLIB, ... }), a) =
69                        if SrcPathSet.member (a, p) then a else go (g, a)
70                      | sl (_, a) = a
71                in
72                    SrcPathSet.add (foldl sl a sublibs, grouppath)
73                end
74            in
75                go (g, SrcPathSet.empty)
76            end
77      end      end
78  end  end

Legend:
Removed from v.451  
changed lines
  Added in v.492

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