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 1879 - (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 : mblume 1879 val anyErrors : groupreg -> SrcPath.file -> bool
21 : blume 281 end
22 :    
23 :     structure GroupReg :> GROUPREG = struct
24 :    
25 : blume 879 type groupreg = Source.inputSource SrcPathMap.map ref
26 : blume 281
27 : blume 354 fun new () = ref SrcPathMap.empty : groupreg
28 : blume 286
29 : blume 354 fun register gr (p, s) = gr := SrcPathMap.insert (!gr, p, s)
30 : mblume 1879 fun lookup gr p =
31 :     case SrcPathMap.find (!gr, p) of
32 :     SOME s => s
33 :     | NONE => raise Fail ("GroupReg.lookup " ^ SrcPath.descr p)
34 : blume 354 fun registered gr g = isSome (SrcPathMap.find (!gr, g))
35 : blume 879 fun error gr (g, r) = ErrorMsg.error (lookup gr g) r
36 : mblume 1879 fun anyErrors gr g = !(#anyErrors (lookup gr g : Source.inputSource))
37 : blume 281 end

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