(* Oukseh Lee Copyright(c) 2000-2004 KAIST/SNU Research On Program Analysis System (National Creative Research Initiative Center 1998-2003) http://ropas.snu.ac.kr/n All rights reserved. This file is distributed under the terms of an Open Source License. *) structure Init = struct val dirs = ref ([]: string list) fun read_dirs dir = (( let val d = Sys.opendir dir fun f() = let val a = Sys.readdir d in a::f() end handle End_of_file => [] val l = f() in Sys.closedir d; List.filter (fn s => Filename.check_suffix s Dump.dumpext) l end) handle _ => []) fun init ds = let val dirs = Config.standard_library :: ds val files = List.flatten (List.map (fn dir => List.map (Filename.concat dir) (read_dirs dir)) dirs) val _ = NEnv.set_base (Predef.init) val bs = List.iter (fn f => ((let (* val _ = Format.printf "Load %s.@." f *) val (b,c) = Dump.load f in NEnv.add_base b; Ty.CE.add_ce c end) handle Dump.Invalid_header => () (* TyError.warning (f^" ´Â(Àº) ´Ù¸¥ ¹öÀüÀ¸·Î ÄÄÆÄÀϵǾî ÀÖ½À´Ï´Ù.") *) | Sys_error _ => ())) files val _ = NEnv.init_open "Pervasives" in () end end