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

Annotation of /sml/trunk/src/cm/semant/members.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 269 - (view) (download)

1 : blume 267 (* just a placeholder so far *)
2 :    
3 :     (*
4 :     * Collections of members in CM descriptions.
5 :     * Involves:
6 :     * - running tools
7 :     * - fully analyzing sub-groups and sub-libraries
8 :     * - parsing ML files and getting their export lists
9 :     *
10 :     * (C) 1999 Lucent Technologies, Bell Laboratories
11 :     *
12 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
13 :     *)
14 :     signature MEMBERCOLLECTION = sig
15 :    
16 : blume 269 type symbol = GenericVC.Symbol.symbol
17 :     type smlinfo = DependencyGraph.smlinfo
18 :    
19 :     exception DuplicateImport of symbol * smlinfo * smlinfo
20 :     exception DuplicateDefinition of symbol * smlinfo * smlinfo
21 :    
22 : blume 267 type collection
23 :    
24 :     val expandOne : AbsPath.t * string option -> collection
25 :     val sequential : collection * collection -> collection
26 :    
27 : blume 268 val num_look : collection -> string -> int
28 :     val ml_look : collection -> GenericVC.Symbol.symbol -> bool
29 :     val cm_look : collection -> string -> bool
30 : blume 267 end
31 :    
32 :     structure MemberCollection :> MEMBERCOLLECTION = struct
33 :    
34 : blume 269 structure DG = DependencyGraph
35 : blume 267
36 : blume 269 type smlinfo = DG.smlinfo
37 :     type symbol = GenericVC.Symbol.symbol
38 : blume 267
39 : blume 269 exception DuplicateImport of symbol * smlinfo * smlinfo
40 :     exception DuplicateDefinition of symbol * smlinfo * smlinfo
41 :    
42 :     datatype collection =
43 :     COLLECTION of { subexports: DG.farnode SymbolMap.map,
44 :     smlfiles: smlinfo list,
45 :     localdefs: smlinfo SymbolMap.map }
46 :    
47 :     fun expandOne (f: AbsPath.t, c: string option) = raise Fail "notyet"
48 :    
49 :     fun sequential (COLLECTION c1, COLLECTION c2) = let
50 :     fun se_error (s, (_, DG.NODE n1), (_, DG.NODE n2)) =
51 :     raise DuplicateImport (s, #smlinfo n1, #smlinfo n2)
52 :     fun ld_error (s, f1, f2) = raise DuplicateDefinition (s, f1, f2)
53 :     val se_union = SymbolMap.unionWithi se_error
54 :     val ld_union = SymbolMap.unionWithi ld_error
55 :     in
56 :     COLLECTION { subexports = se_union (#subexports c1, #subexports c2),
57 :     smlfiles = #smlfiles c1 @ #smlfiles c2,
58 :     localdefs = ld_union (#localdefs c1, #localdefs c2) }
59 :     end
60 :    
61 : blume 268 fun num_look (c: collection) (s: string) = 0
62 : blume 269
63 : blume 268 fun cm_look (c: collection) (s: string) = false
64 : blume 269
65 :     fun ml_look (COLLECTION { subexports, localdefs, ... }) s =
66 :     isSome (SymbolMap.find (subexports, s)) orelse
67 :     isSome (SymbolMap.find (localdefs, s))
68 : blume 267 end

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