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/compiler/ElabData/main/compinfo.sml
ViewVC logotype

View of /sml/trunk/src/compiler/ElabData/main/compinfo.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 902 - (download) (annotate)
Wed Aug 15 21:17:05 2001 UTC (18 years, 10 months ago) by blume
File size: 1051 byte(s)
new organization of compiler libraries
(* compinfo.sml
 *
 * (C) 2001 Lucent Technologies, Bell Labs
 *)
structure CompInfo = struct

    type 'absyn compInfo = { mkStamp: unit -> Stamps.stamp,
                      mkLvar: Symbol.symbol option -> Access.lvar,
                      anyErrors: bool ref,
                      error: ErrorMsg.errorFn,
                      errorMatch: SourceMap.region -> string,
                      transform: 'absyn -> 'absyn,
                      sourceName : string }

    fun mkCompInfo { source, transform : 'a -> 'a, mkMkStamp } = let
	val { error, errorMatch, anyErrors } = ErrorMsg.errors source
	val _ = LambdaVar.clear ()
	val g = mkMkStamp ()
	fun mkLvar NONE = LambdaVar.mkLvar ()
	  | mkLvar (SOME sym) = LambdaVar.namedLvar sym
    in
	{ mkStamp = fn () => Stamps.fresh g,
	  mkLvar = mkLvar,
	  anyErrors = anyErrors,
	  error = error,
	  errorMatch = errorMatch,
	  transform = transform,
	  sourceName = #fileOpened source } : 'a compInfo
    end

    fun anyErrors (ci : 'a compInfo) = ! (#anyErrors ci)

end (* structure CompBasic *)

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