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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download)

1 : blume 275 (*
2 :     * Get the toplevel exports from a skeleton.
3 :     *
4 :     * (C) 1999 Lucent Technologies, Bell Laboratories
5 :     *
6 :     * contact: Matthias Blume (blume@cs.princeton.edu)
7 :     *)
8 :     signature SKELEXPORTS = sig
9 :     val exports : Skeleton.decl -> SymbolSet.set
10 :     end
11 :    
12 :     structure SkelExports :> SKELEXPORTS = struct
13 :    
14 :     structure SK = Skeleton
15 :     structure SS = SymbolSet
16 :    
17 :     fun exports d = let
18 : blume 286 fun e (SK.Bind (s, _), a) = SS.add (a, s)
19 :     | e (SK.Local (l, b), a) = e (b, a)
20 :     | e (SK.Par l, a) = foldl e a l
21 :     | e (SK.Seq l, a) = foldl e a l
22 :     | e (SK.Open _, a) = a (* cannot happen *)
23 :     | e (SK.Ref _, a) = a
24 : blume 275 in
25 :     e (d, SS.empty)
26 :     end
27 :     end

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