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 537 - (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 354 val register : groupreg -> SrcPath.t * GenericVC.Source.inputSource -> unit
15 :     val lookup : groupreg -> SrcPath.t -> GenericVC.Source.inputSource
16 :     val registered : groupreg -> SrcPath.t -> bool
17 : blume 297 val error :
18 :     groupreg
19 : blume 354 -> SrcPath.t * GenericVC.SourceMap.region
20 : blume 297 -> GenericVC.ErrorMsg.complainer
21 : blume 281 end
22 :    
23 :     structure GroupReg :> GROUPREG = struct
24 :    
25 : blume 354 type groupreg = GenericVC.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 :     fun lookup gr p = valOf (SrcPathMap.find (!gr, p))
31 : blume 537 handle Option => raise Fail ("GroupReg.lookup " ^ SrcPath.descr p)
32 : blume 354 fun registered gr g = isSome (SrcPathMap.find (!gr, g))
33 : blume 297 fun error gr (g, r) = GenericVC.ErrorMsg.error (lookup gr g) r
34 : blume 281 end

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