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

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

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

revision 536, Fri Feb 18 16:51:54 2000 UTC revision 537, Fri Feb 18 17:20:16 2000 UTC
# Line 6  Line 6 
6   *   *
7   * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)   * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
8   *)   *)
9  functor MkListFn (type element  structure MkList :> sig
10                    val bininfo : BinInfo.info -> element      val group : { bininfo: BinInfo.info -> 'element,
11                    val smlinfo : SmlInfo.info -> element) :>                    smlinfo: SmlInfo.info -> 'element,
12  sig                    Cons: 'element * 'elements -> 'elements,
13      val group : GroupGraph.group -> element list                    Nil: 'elements } ->
14            GroupGraph.group -> 'elements
15  end = struct  end = struct
16    
17      structure DG = DependencyGraph      structure DG = DependencyGraph
# Line 23  Line 24 
24      fun do_list do_elem [] k m = k m      fun do_list do_elem [] k m = k m
25        | do_list do_elem (h :: t) k m = do_elem h (do_list do_elem t k) m        | do_list do_elem (h :: t) k m = do_elem h (do_list do_elem t k) m
26    
27      fun bnode (DG.PNODE _) k m = k m      fun group { bininfo, smlinfo, Cons, Nil } g = let
28        | bnode (DG.BNODE n) k m = let          val GroupGraph.GROUP { exports, ... } = g
29            fun bnode (DG.BNODE n) k m = let
30              val { bininfo = i, localimports = l, globalimports = g } = n              val { bininfo = i, localimports = l, globalimports = g } = n
31              fun k' m = bininfo i :: k (stab_reg (m, i))              fun k' m = Cons (bininfo i, k (stab_reg (m, i)))
32          in          in
33              if stab_isreg (m, i) then k m              if stab_isreg (m, i) then k m
34              else do_list bnode l (do_list farbnode g k') m              else do_list bnode l (do_list farbnode g k') m
# Line 36  Line 38 
38    
39      fun snode (DG.SNODE n) k m = let      fun snode (DG.SNODE n) k m = let
40          val { smlinfo = i, localimports = l, globalimports = g } = n          val { smlinfo = i, localimports = l, globalimports = g } = n
41          fun k' m = smlinfo i :: k (sml_reg (m, i))              fun k' m = Cons (smlinfo i, k (sml_reg (m, i)))
42      in      in
43          if sml_isreg (m, i) then k m          if sml_isreg (m, i) then k m
44          else do_list snode l (do_list farsbnode g k') m          else do_list snode l (do_list farsbnode g k') m
# Line 46  Line 48 
48        | farsbnode (_, DG.SB_SNODE n) = snode n        | farsbnode (_, DG.SB_SNODE n) = snode n
49    
50      fun impexp (n, _) = farsbnode n      fun impexp (n, _) = farsbnode n
51        in
     fun group (GroupGraph.GROUP { exports, ... }) =  
52          do_list impexp (SymbolMap.listItems exports)          do_list impexp (SymbolMap.listItems exports)
53                         (fn _ => [])                         (fn _ => Nil)
54                         (StableSet.empty, SmlInfoSet.empty)                         (StableSet.empty, SmlInfoSet.empty)
55  end  end
56    end

Legend:
Removed from v.536  
changed lines
  Added in v.537

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