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/branches/SMLNJ/src/compiler/TopLevel/bootstrap/boot.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/compiler/TopLevel/bootstrap/boot.sml

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

revision 23, Thu Mar 12 00:49:56 1998 UTC revision 24, Thu Mar 12 00:49:58 1998 UTC
# Line 12  Line 12 
12    
13  local  local
14    structure SS = Substring    structure SS = Substring
15    structure C  = VC.Compile    structure Compile = VC.Compile
   structure BU = VC.BatchUtil  
16    structure SE = StaticEnv    structure SE = StaticEnv
17    structure SC = SCStaticEnv    structure SC = SCStaticEnv
18    open ErrorMsg Modules ModuleUtil    open ErrorMsg Modules ModuleUtil
# Line 34  Line 33 
33    infix //    infix //
34    val op // = SC.atop    val op // = SC.atop
35    
36    fun loadcomp (env,fname) : loadres =    fun load (env,fname) : loadres =
37        let val _ = say (concat ["[Elaborating ", fname, "]\n"])        let val _ = say (concat ["[Elaborating ", fname, "]\n"])
38            val stream = TextIO.openIn fname            val stream = TextIO.openIn fname
39            val source = Source.newSource (            val source = Source.newSource (
40                  fname, 1, stream, false, ErrorMsg.defaultConsumer ())                  fname, 1, stream, false, ErrorMsg.defaultConsumer ())
41            val ast = C.parse source            val ast = Compile.parse source
42            val cinfo = C.mkCompInfo(source, #get EnvRef.core (), fn x=>x)            val compInfo =
43            val {absyn, newstatenv=newenv, exportPid, ...} =                 Compile.mkCompInfo(source, #get EnvRef.core (), fn x=>x)
44                 C.elaborate{statenv=env, compInfo = cinfo, ast=ast}            val {absyn, newenv, exportPid, ...} =
45                   Compile.elaborate{compenv=env, compInfo = compInfo, ast=ast}
           (* ZHONG commented this out, because why bother ?  
   
46            val showenv = StaticEnv.atop(SC.unSC newenv, SC.unSC env)            val showenv = StaticEnv.atop(SC.unSC newenv, SC.unSC env)
47            fun show (Absyn.SEQdec decs) = app show decs            fun show (Absyn.SEQdec decs) = app show decs
48              | show (Absyn.MARKdec (d,_)) = show d              | show (Absyn.MARKdec (d,_)) = show d
# Line 56  Line 53 
53                                   dynamic = DynamicEnv.empty,                                   dynamic = DynamicEnv.empty,
54                                   symbolic = SymbolicEnv.empty}                                   symbolic = SymbolicEnv.empty}
55                        ppstrm (absyn,[]))                        ppstrm (absyn,[]))
56             *)         in show absyn handle _ => say "ppDec raised exception\n";
        in (* show absyn handle _ => say "ppDec raised exception\n"; *)  
57            TextIO.closeIn stream;            TextIO.closeIn stream;
58            {scsenv = newenv, exportPid = exportPid}            {scsenv = newenv, exportPid = exportPid}
59        end        end
# Line 147  Line 143 
143        end        end
144    
145    (* elabCompiler accumulates compiler environment atop the pervasive env *)    (* elabCompiler accumulates compiler environment atop the pervasive env *)
146    fun elabCompiler (load, pervEnv, bindir) =    fun elabCompiler (pervEnv, bindir) =
147        let val srclist = readBinFile(bindir, "SRCLIST")        let val srclist = readBinFile(bindir, "SRCLIST")
148            (* don't elaborate the last file! it's the glue that hasn't            (* don't elaborate the last file! it's the glue that hasn't
149             * finished executing.             * finished executing.
# Line 168  Line 164 
164                      flush ();                      flush ();
165                      raise ex)                      raise ex)
166    
167    val bindir = ref ("bin." ^ VC.architecture)    val bindir = ref ("bin." ^ Compile.architecture)
168    val full = ref false    val full = ref false
169    
170    val _ =    val _ =
# Line 207  Line 203 
203                    say (concat ["Loading static bin for ", sourcename, "\n"])                    say (concat ["Loading static bin for ", sourcename, "\n"])
204                  val f = BinIO.openIn (tnamer sourcename)                  val f = BinIO.openIn (tnamer sourcename)
205    
206                  val cu = BU.readUnit { name=tnamer sourcename,                  val cu = VC.CUnitUtil.readUnit { name=tnamer sourcename,
207                                                   stream = f,                                                   stream = f,
208                                                   pids2iid = fn _ => (),                                                   pids2iid = fn _ => (),
209                                                   senv = env0,                                                   senv = env0,
210                                                   keep_code = false }                                                   keep_code = false }
211                  val exportPid = BU.exportCU cu                  val exportPid = VC.CUnitUtil.exportCU cu
212                  val senv = BU.senvCU cu                  val senv = VC.CUnitUtil.senvCU cu
213                  val symenv = BU.symenvCU cu                  val symenv = VC.CUnitUtil.symenvCU cu
214    
215               in theSymEnv := SymbolicEnv.atop (symenv, !theSymEnv);               in theSymEnv := SymbolicEnv.atop (symenv, !theSymEnv);
216                  BinIO.closeIn f;                  BinIO.closeIn f;
# Line 222  Line 218 
218              end              end
219    
220            fun getVisComp env0 =            fun getVisComp env0 =
221                let val srcname = VC.architecture ^ "vis.sml"                let val srcname = Compile.architecture ^ "vis.sml"
222                    val files = readBinFile(!bindir, "SRCLIST")                    val files = readBinFile(!bindir, "SRCLIST")
223                    fun f (env, fname :: rest) =                    fun f (env, fname :: rest) =
224                        let val {scsenv, ...} = getbin(env,fname)                        let val {scsenv, ...} = getbin(env,fname)
# Line 240  Line 236 
236                    let val _ = say "\nNow elaborating boot directory\n"                    let val _ = say "\nNow elaborating boot directory\n"
237                        val savedOverloadKW = !VC.Control.overloadKW                        val savedOverloadKW = !VC.Control.overloadKW
238                        val _ = VC.Control.overloadKW := true                        val _ = VC.Control.overloadKW := true
239                        val (pSE, pids) = newBootEnv (loadcomp, !bindir)                        val (pSE, pids) = newBootEnv (load, !bindir)
240                        val (vSE, morepids) =                        val (vSE, morepids) = elabCompiler (pSE, !bindir)
                         elabCompiler (loadcomp, pSE, !bindir)  
241                     in VC.Control.overloadKW := savedOverloadKW;                     in VC.Control.overloadKW := savedOverloadKW;
242                        ((pSE, pids @ morepids), vSE)                        ((pSE, pids @ morepids), vSE)
243                    end                    end
# Line 255  Line 250 
250            val pervStatEnv = SE.consolidate(SC.unSC pervStatEnv)            val pervStatEnv = SE.consolidate(SC.unSC pervStatEnv)
251            val visCompEnv = SE.consolidate(SC.unSC visCompEnv)            val visCompEnv = SE.consolidate(SC.unSC visCompEnv)
252    
253            val vcSym = Symbol.strSymbol (sname (VC.architecture) ^ "VisComp")            val vcSym = Symbol.strSymbol (sname (Compile.architecture) ^ "VisComp")
254            val vcBind as Bindings.STRbind(vcStr) =            val vcBind as Bindings.STRbind(vcStr) =
255                  SE.look(visCompEnv, vcSym)                  SE.look(visCompEnv, vcSym)
256    

Legend:
Removed from v.23  
changed lines
  Added in v.24

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