Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/cm/semant/group-reg.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 297 - (download) (annotate)
Thu May 27 08:29:19 1999 UTC (21 years, 1 month ago) by blume
File size: 1056 byte(s)
persistent state/error handling bogosity fixed
(*
 * The "group registry".  CM uses this to remember which groups it is
 * currently working on and what the corresponding input sources are.
 *
 * (C) 1999 Lucent Technologies, Bell Laboratories
 *
 * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
 *)
signature GROUPREG = sig

    type groupreg

    val new : unit -> groupreg
    val register : groupreg -> AbsPath.t * GenericVC.Source.inputSource -> unit
    val lookup : groupreg -> AbsPath.t -> GenericVC.Source.inputSource
    val registered : groupreg -> AbsPath.t -> bool
    val error :
	groupreg
	-> AbsPath.t * GenericVC.SourceMap.region
	-> GenericVC.ErrorMsg.complainer
end

structure GroupReg :> GROUPREG = struct

    type groupreg = GenericVC.Source.inputSource AbsPathMap.map ref

    fun new () = ref AbsPathMap.empty : groupreg

    fun register gr (p, s) = gr := AbsPathMap.insert (!gr, p, s)
    fun lookup gr p = valOf (AbsPathMap.find (!gr, p))
    fun registered gr g = isSome (AbsPathMap.find (!gr, g))
    fun error gr (g, r) = GenericVC.ErrorMsg.error (lookup gr g) r
end

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