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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cm/depend/graph.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/depend/graph.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 295 - (view) (download)

1 : blume 270 (*
2 :     * Internal data structure representing a CM dependency graph.
3 : blume 294 * (fine-grain: compilation units)
4 : blume 270 *
5 :     * (C) 1999 Lucent Technologies, Bell Laboratories
6 :     *
7 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
8 :     *)
9 : blume 269 structure DependencyGraph = struct
10 :    
11 : blume 272 type primitive = Primitive.primitive
12 : blume 269
13 :     type filter = SymbolSet.set option
14 :    
15 : blume 282 type 'n filtered = filter * 'n
16 : blume 269
17 : blume 282 datatype bnode =
18 :     PNODE of primitive
19 : blume 294 | BNODE of { bininfo: BinInfo.info,
20 : blume 282 localimports: bnode list,
21 :     globalimports: farbnode list }
22 : blume 269
23 : blume 282 withtype farbnode = bnode filtered
24 :    
25 :     datatype snode =
26 :     SNODE of { smlinfo: SmlInfo.info,
27 :     localimports: snode list,
28 :     globalimports: farsbnode list }
29 :    
30 :     and sbnode =
31 :     SB_BNODE of bnode
32 :     | SB_SNODE of snode
33 :    
34 :     withtype farsbnode = sbnode filtered
35 :    
36 : blume 286 type impexp = farsbnode * DAEnv.env
37 : blume 270
38 : blume 282 fun describeSBN (SB_BNODE (PNODE p)) = Primitive.toString p
39 :     | describeSBN (SB_BNODE (BNODE { bininfo = i, ... })) =
40 : blume 294 BinInfo.describe i
41 : blume 282 | describeSBN (SB_SNODE (SNODE { smlinfo = i, ... })) =
42 : blume 280 SmlInfo.fullName i
43 : blume 282
44 :     fun describeFarSBN (_, sbn) = describeSBN sbn
45 :    
46 :     (* comparing various nodes for equality *)
47 :     fun beq (PNODE p, PNODE p') = Primitive.eq (p, p')
48 :     | beq (BNODE { bininfo = i, ... }, BNODE { bininfo = i', ... }) =
49 : blume 295 BinInfo.compare (i, i') = EQUAL
50 : blume 282 | beq _ = false
51 :     fun seq (SNODE { smlinfo = i, ... }, SNODE { smlinfo = i', ... }) =
52 :     SmlInfo.eq (i, i')
53 :     fun sbeq (SB_BNODE bn, SB_BNODE bn') = beq (bn, bn')
54 :     | sbeq (SB_SNODE sn, SB_SNODE sn') = seq (sn, sn')
55 :     | sbeq _ = false
56 : blume 269 end

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