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/smlfile/skel-exports.sml
ViewVC logotype

View of /sml/trunk/src/cm/smlfile/skel-exports.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 286 - (download) (annotate)
Fri May 21 07:47:16 1999 UTC (20 years, 5 months ago) by blume
File size: 631 byte(s)
skeleton type simplified; improved conversion, etc.
(*
 * Get the toplevel exports from a skeleton.
 *
 * (C) 1999 Lucent Technologies, Bell Laboratories
 *
 * contact: Matthias Blume (blume@cs.princeton.edu)
 *)
signature SKELEXPORTS = sig
    val exports : Skeleton.decl -> SymbolSet.set
end

structure SkelExports :> SKELEXPORTS = struct

    structure SK = Skeleton
    structure SS = SymbolSet

    fun exports d = let
	fun e (SK.Bind (s, _), a) = SS.add (a, s)
	  | e (SK.Local (l, b), a) = e (b, a)
	  | e (SK.Par l, a) = foldl e a l
	  | e (SK.Seq l, a) = foldl e a l
	  | e (SK.Open _, a) = a	(* cannot happen *)
	  | e (SK.Ref _, a) = a
    in
	e (d, SS.empty)
    end
end

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