SCM Repository
Annotation of /sml/trunk/src/cm/smlfile/skel-exports.sml
Parent Directory
|
Revision Log
Revision 275 - (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 : | fun e (SK.StrDecl l, a) = SS.addList (a, map #name l) | ||
19 : | | e (SK.FctDecl l, a) = SS.addList (a, map #name l) | ||
20 : | | e (SK.LocalDecl (l, b), a) = e (b, a) | ||
21 : | | e (SK.SeqDecl l, a) = foldl e a l | ||
22 : | | e (SK.OpenDecl _, a) = a (* cannot happen *) | ||
23 : | | e (SK.DeclRef _, a) = a | ||
24 : | in | ||
25 : | e (d, SS.empty) | ||
26 : | end | ||
27 : | end |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |