
1 // 2 // Copyright (c) 2006, Brian Frank and Andy Frank 3 // Licensed under the Academic Free License version 3.0 4 // 5 // History: 6 // 20 Aug 06 Brian Frank Creation 7 // 8 9 ** 10 ** LoadPod is used to immediately load the pod which has 11 ** just been successfully compiled into Compiler.fpod. This 12 ** step is only used with script compiles. 13 ** 14 class LoadPod : CompilerStep 15 { 16 17 ////////////////////////////////////////////////////////////////////////// 18 // Construction 19 ////////////////////////////////////////////////////////////////////////// 20 21 ** 22 ** Constructor takes the associated Compiler 23 ** 24 new make(Compiler compiler) 25 : super(compiler) 26 { 27 } 28 29 ////////////////////////////////////////////////////////////////////////// 30 // Methods 31 ////////////////////////////////////////////////////////////////////////// 32 33 ** 34 ** Not used, use load instead 35 ** 36 override Void run() { throw UnsupportedErr.make } 37 38 ** 39 ** Run the step and return loaded Pod instance 40 ** 41 Pod load() 42 { 43 // create memory buffer to store pod zip 44 buf := Buf.make(4096) 45 46 // write the fpod to memory buf 47 fpod := compiler.fpod 48 fpod.zip = Zip.write(buf.out) 49 fpod.write 50 fpod.zip.close 51 52 // have Sys load it up 53 return Pod.load(buf.flip.in) 54 } 55 56 }