signature TRANSMAIN = sig exception BadParseResult of MLParser.parseResult val transMain : unit -> {flint:FLINT.prog, imports:(PersStamps.persstamp * ImportTree.importTree) list} end (* sig *) structure TransMain : TRANSMAIN = struct local structure SigMatch = SigMatchFn (structure EV = EvalEntity) structure Typecheck = TypecheckFn (val ii_ispure = InlInfo.pureInfo val ii2ty = InstantiateParam.ii2ty) structure ElabMod = ElabModFn (structure SM = SigMatch structure Typecheck = Typecheck) structure ElabTop = ElabTopFn (structure ElabMod = ElabMod) in exception BadParseResult of MLParser.parseResult fun transMain () = let val initenv = PrimEnv.primEnv fun gettree (MLParser.PARSE(t)) = t | gettree x = raise BadParseResult x val source = Source.newSource ("stdIn", 1, TextIO.stdIn, true, ErrorMsg.defaultConsumer()) val astdec = gettree (MLParser.parse source ()) val cinfo = CompInfo.mkCompInfo {source = source, transform = fn x : Absyn.dec => x, mkMkStamp = Stamps.newGenerator} val (rootdec, newenv) = ElabTop.elabTop (astdec, initenv, cinfo) val staticenv = StaticEnv.atop (initenv, newenv) val {exportLvars, ...} = PickUnpick.pickUnpick {context = initenv, env = newenv, guid = ""} (* [LambdaVar.mkLvar()] *) in Translate.transDec {compInfo = cinfo, cproto_conv = "cpc", env = staticenv, exportLvars = exportLvars, rootdec = rootdec} end end (* local *) end (* struct *)