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/branches/SMLNJ/src/cm/depend/graph.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/cm/depend/graph.sml

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

revision 629, Wed Apr 26 04:06:41 2000 UTC revision 630, Wed Apr 26 18:40:56 2000 UTC
# Line 1  Line 1 
1    (*
2     * Internal data structure representing a CM dependency graph.
3     * (fine-grain: compilation units)
4     *
5     * (C) 1999 Lucent Technologies, Bell Laboratories
6     *
7     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
8     *)
9    local
10        structure E = GenericVC.Environment
11        type pid = GenericVC.PersStamps.persstamp
12    in
13  structure DependencyGraph = struct  structure DependencyGraph = struct
14    
15      type smlinfo = unit      type primitive = Primitive.primitive
     type groupinfo = unit  
     type primitive = unit  
16    
17      type filter = SymbolSet.set option      type filter = SymbolSet.set option
18    
19      datatype node =      type 'n filtered = filter * 'n
         PNODE of primitive  
       | NODE of { smlinfo: smlinfo,  
                   localimports: node list,  
                   globalimports: farnode list }  
   
     withtype farnode = filter * node  
   
     (* the filter is duplicated in each member of the map to  
      * make it easier to build the global graph *)  
     datatype gnode =  
         GNODE of { groupinfo: groupinfo,  
                    imports: gnode list,  
                    filter: filter,  
                    exports: farnode SymbolMap.map,  
                    dangling: node list }  
20    
21        datatype bnode =
22            PNODE of primitive
23          | BNODE of { bininfo: BinInfo.info,
24                       localimports: bnode list,
25                       globalimports: farbnode list }
26    
27        withtype farbnode = bnode filtered
28    
29        datatype snode =
30            SNODE of { smlinfo: SmlInfo.info,
31                       localimports: snode list,
32                       globalimports: farsbnode list }
33    
34        and sbnode =
35            SB_BNODE of bnode * IInfo.info
36          | SB_SNODE of snode
37    
38        withtype farsbnode = sbnode filtered
39    
40        type impexp = farsbnode * DAEnv.env
41    
42        fun describeSBN (SB_BNODE (PNODE p, _)) = Primitive.toString p
43          | describeSBN (SB_BNODE (BNODE { bininfo = i, ... }, _)) =
44            BinInfo.describe i
45          | describeSBN (SB_SNODE (SNODE { smlinfo = i, ... })) =
46            SmlInfo.fullDescr i
47    
48        fun describeFarSBN (_, sbn) = describeSBN sbn
49    
50        (* comparing various nodes for equality *)
51        fun beq (PNODE p, PNODE p') = Primitive.eq (p, p')
52          | beq (BNODE { bininfo = i, ... }, BNODE { bininfo = i', ... }) =
53            BinInfo.compare (i, i') = EQUAL
54          | beq _ = false
55        fun seq (SNODE { smlinfo = i, ... }, SNODE { smlinfo = i', ... }) =
56            SmlInfo.eq (i, i')
57    
58        fun sbeq (SB_SNODE n, SB_SNODE n') = seq (n, n')
59          | sbeq (SB_BNODE (n, _), SB_BNODE (n', _)) = beq (n, n')
60          | sbeq _ = false
61  end  end
62    end
63    

Legend:
Removed from v.629  
changed lines
  Added in v.630

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