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 283 - (view) (download)

1 : blume 270 (*
2 :     * Internal data structure representing a CM dependency graph.
3 :     *
4 :     * (C) 1999 Lucent Technologies, Bell Laboratories
5 :     *
6 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7 :     *)
8 : blume 269 structure DependencyGraph = struct
9 :    
10 : blume 278 type symbol = Symbol.symbol
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 :     | BNODE of { bininfo: Dummy.t, (* BinInfo.info *)
20 :     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 278 (* environments used for dependency analysis *)
37 :     datatype env =
38 :     EMPTY
39 :     | FCTENV of { looker: symbol -> value option,
40 :     domain: unit -> SymbolSet.set }
41 :     | BINDING of symbol * value
42 :     | LAYER of env * env
43 : blume 270
44 : blume 278 withtype value = env
45 :    
46 : blume 283 type impexp = farsbnode * env
47 :    
48 : blume 282 fun describeSBN (SB_BNODE (PNODE p)) = Primitive.toString p
49 :     | describeSBN (SB_BNODE (BNODE { bininfo = i, ... })) =
50 :     (ignore Dummy.v; "bininfo")
51 :     | describeSBN (SB_SNODE (SNODE { smlinfo = i, ... })) =
52 : blume 280 SmlInfo.fullName i
53 : blume 282
54 :     fun describeFarSBN (_, sbn) = describeSBN sbn
55 :    
56 :     (* comparing various nodes for equality *)
57 :     fun beq (PNODE p, PNODE p') = Primitive.eq (p, p')
58 :     | beq (BNODE { bininfo = i, ... }, BNODE { bininfo = i', ... }) =
59 :     (ignore Dummy.v; false)
60 :     | beq _ = false
61 :     fun seq (SNODE { smlinfo = i, ... }, SNODE { smlinfo = i', ... }) =
62 :     SmlInfo.eq (i, i')
63 :     fun sbeq (SB_BNODE bn, SB_BNODE bn') = beq (bn, bn')
64 :     | sbeq (SB_SNODE sn, SB_SNODE sn') = seq (sn, sn')
65 :     | sbeq _ = false
66 : blume 269 end

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