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

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/semant/semant.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/semant/semant.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 293, Tue May 25 03:04:50 1999 UTC revision 294, Tue May 25 09:06:06 1999 UTC
# Line 12  Line 12 
12      type ml_symbol      type ml_symbol
13      type cm_symbol      type cm_symbol
14    
15      type group      type group = GroupGraph.group
16    
17      type privileges      type privilegespec = GroupGraph.privilegespec
     type privilegespec  
18      type aexp      type aexp
19      type exp      type exp
20      type members                        (* still conditional *)      type members                        (* still conditional *)
# Line 50  Line 49 
49      val emptyMembers : members      val emptyMembers : members
50      val member : GeneralParams.params * (pathname -> group)      val member : GeneralParams.params * (pathname -> group)
51          -> { sourcepath: pathname, group: pathname, class: cm_symbol option,          -> { sourcepath: pathname, group: pathname, class: cm_symbol option,
52               error: string -> (PrettyPrint.ppstream -> unit) -> unit }               error: GenericVC.ErrorMsg.complainer }
53          -> members          -> members
54      val members : members * members -> members      val members : members * members -> members
55      val guarded_members :      val guarded_members :
# Line 94  Line 93 
93  structure CMSemant :> CM_SEMANT = struct  structure CMSemant :> CM_SEMANT = struct
94    
95      structure SymPath = GenericVC.SymPath      structure SymPath = GenericVC.SymPath
96        structure EM = GenericVC.ErrorMsg
97        structure GG = GroupGraph
98    
99      type pathname = AbsPath.t      type pathname = AbsPath.t
100      type context = AbsPath.context      type context = AbsPath.context
101      type ml_symbol = Symbol.symbol      type ml_symbol = Symbol.symbol
102      type cm_symbol = string      type cm_symbol = string
103    
104      type privileges = StringSet.set      type group = GG.group
105      type privilegespec = { required : privileges, granted : privileges }      type privilegespec = GG.privilegespec
   
     datatype group =  
         GROUP of { exports: DependencyGraph.impexp SymbolMap.map,  
                    islib: bool,  
                    privileges: privilegespec,  
                    grouppath: AbsPath.t }  
106    
107      type environment = MemberCollection.collection      type environment = MemberCollection.collection
108    
# Line 135  Line 130 
130      fun applyTo mc e = e mc      fun applyTo mc e = e mc
131    
132      fun emptyGroup path =      fun emptyGroup path =
133          GROUP { exports = SymbolMap.empty,          GG.GROUP { exports = SymbolMap.empty,
134                  islib = false,                  islib = false,
135                  privileges = { required = StringSet.empty,                  privileges = { required = StringSet.empty,
136                                 granted = StringSet.empty },                                 granted = StringSet.empty },
137                  grouppath = path }                     grouppath = path,
138                       subgroups = [] }
139    
140    
141      fun group (g, p, e, m, error) = let      fun group (g, p, e, m, error) = let
142          val mc = applyTo MemberCollection.empty m          val mc = applyTo MemberCollection.empty m
143          val filter = Option.map (applyTo mc) e          val filter = Option.map (applyTo mc) e
144          val exports = MemberCollection.build (mc, filter, error)          val exports = MemberCollection.build (mc, filter, error)
145            val subgroups = MemberCollection.subgroups mc
146      in      in
147          GROUP { exports = exports, islib = false,          GG.GROUP { exports = exports, islib = false,
148                  privileges = p, grouppath = g }                     privileges = p, grouppath = g,
149                       subgroups = subgroups }
150      end      end
151    
152      fun library (g, p, e, m, error) = let      fun library (g, p, e, m, error) = let
153          val mc = applyTo MemberCollection.empty m          val mc = applyTo MemberCollection.empty m
154          val filter = applyTo mc e          val filter = applyTo mc e
155          val exports = MemberCollection.build (mc, SOME filter, error)          val exports = MemberCollection.build (mc, SOME filter, error)
156            val subgroups = MemberCollection.subgroups mc
157      in      in
158          GROUP { exports = exports, islib = true,          GG.GROUP { exports = exports, islib = true,
159                  privileges = p, grouppath = g }                     privileges = p, grouppath = g,
160                       subgroups = subgroups }
161      end      end
162    
163      local      local
# Line 177  Line 177 
177               { required = required, granted = StringSet.add (granted, s) })               { required = required, granted = StringSet.add (granted, s) })
178      end      end
179    
     (* get the export map from a group *)  
     fun getExports (GROUP { exports, islib, ... }) =  
         { imports = exports,  
           gimports = if islib then SymbolMap.empty else exports }  
   
180      fun emptyMembers env = env      fun emptyMembers env = env
181      fun member (params, rparse) arg env = let      fun member (params, rparse) arg env = let
182          val coll = MemberCollection.expandOne (params, getExports o rparse) arg          val coll = MemberCollection.expandOne (params, rparse) arg
183          val error = #error arg          val error = #error arg
184          fun e0 s = error s GenericVC.ErrorMsg.nullErrorBody          fun e0 s = error EM.COMPLAIN s EM.nullErrorBody
185      in      in
186          MemberCollection.sequential (env, coll, e0)          MemberCollection.sequential (env, coll, e0)
187      end      end

Legend:
Removed from v.293  
changed lines
  Added in v.294

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