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/group-reg.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/semant/group-reg.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 879 - (view) (download)

1 : blume 286 (*
2 :     * The "group registry". CM uses this to remember which groups it is
3 : blume 294 * currently working on and what the corresponding input sources are.
4 : blume 286 *
5 :     * (C) 1999 Lucent Technologies, Bell Laboratories
6 :     *
7 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
8 :     *)
9 : blume 281 signature GROUPREG = sig
10 : blume 286
11 :     type groupreg
12 :    
13 :     val new : unit -> groupreg
14 : blume 666 val register :
15 : blume 879 groupreg -> SrcPath.file * Source.inputSource -> unit
16 :     val lookup : groupreg -> SrcPath.file -> Source.inputSource
17 : blume 666 val registered : groupreg -> SrcPath.file -> bool
18 : blume 879 val error : groupreg ->
19 :     SrcPath.file * SourceMap.region -> ErrorMsg.complainer
20 : blume 281 end
21 :    
22 :     structure GroupReg :> GROUPREG = struct
23 :    
24 : blume 879 type groupreg = Source.inputSource SrcPathMap.map ref
25 : blume 281
26 : blume 354 fun new () = ref SrcPathMap.empty : groupreg
27 : blume 286
28 : blume 354 fun register gr (p, s) = gr := SrcPathMap.insert (!gr, p, s)
29 :     fun lookup gr p = valOf (SrcPathMap.find (!gr, p))
30 : blume 537 handle Option => raise Fail ("GroupReg.lookup " ^ SrcPath.descr p)
31 : blume 354 fun registered gr g = isSome (SrcPathMap.find (!gr, g))
32 : blume 879 fun error gr (g, r) = ErrorMsg.error (lookup gr g) r
33 : blume 281 end

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