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 282 - (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 270 type groupinfo = Dummy.t
12 : blume 272 type primitive = Primitive.primitive
13 : blume 269
14 :     type filter = SymbolSet.set option
15 :    
16 : blume 282 type 'n filtered = filter * 'n
17 : blume 269
18 : blume 282 datatype bnode =
19 :     PNODE of primitive
20 :     | BNODE of { bininfo: Dummy.t, (* BinInfo.info *)
21 :     localimports: bnode list,
22 :     globalimports: farbnode list }
23 : blume 269
24 : blume 282 withtype farbnode = bnode filtered
25 :    
26 :     datatype snode =
27 :     SNODE of { smlinfo: SmlInfo.info,
28 :     localimports: snode list,
29 :     globalimports: farsbnode list }
30 :    
31 :     and sbnode =
32 :     SB_BNODE of bnode
33 :     | SB_SNODE of snode
34 :    
35 :     withtype farsbnode = sbnode filtered
36 :    
37 : blume 278 (* environments used for dependency analysis *)
38 :     datatype env =
39 :     EMPTY
40 :     | FCTENV of { looker: symbol -> value option,
41 :     domain: unit -> SymbolSet.set }
42 :     | BINDING of symbol * value
43 :     | LAYER of env * env
44 : blume 270
45 : blume 278 withtype value = env
46 :    
47 : blume 282 fun describeSBN (SB_BNODE (PNODE p)) = Primitive.toString p
48 :     | describeSBN (SB_BNODE (BNODE { bininfo = i, ... })) =
49 :     (ignore Dummy.v; "bininfo")
50 :     | describeSBN (SB_SNODE (SNODE { smlinfo = i, ... })) =
51 : blume 280 SmlInfo.fullName i
52 : blume 282
53 :     fun describeFarSBN (_, sbn) = describeSBN sbn
54 :    
55 :     (* comparing various nodes for equality *)
56 :     fun beq (PNODE p, PNODE p') = Primitive.eq (p, p')
57 :     | beq (BNODE { bininfo = i, ... }, BNODE { bininfo = i', ... }) =
58 :     (ignore Dummy.v; false)
59 :     | beq _ = false
60 :     fun seq (SNODE { smlinfo = i, ... }, SNODE { smlinfo = i', ... }) =
61 :     SmlInfo.eq (i, i')
62 :     fun sbeq (SB_BNODE bn, SB_BNODE bn') = beq (bn, bn')
63 :     | sbeq (SB_SNODE sn, SB_SNODE sn') = seq (sn, sn')
64 :     | sbeq _ = false
65 : blume 269 end

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