private static void CompileProgram() { IL.Program prog; if (Input == null) { prog = Frontend.Core.CompileFromStdin(); } else { prog = Frontend.Core.CompileFromFile(Input); } Optimization.Program optProg = Optimization.Core.Optimize(prog); var cilProg = new CIL.Program(optProg); var sw = new System.IO.StreamWriter("Program.il"); cilProg.Emit(sw, CIL.EmissionType.Program); sw.Close(); Assembler.Assembler.Invoke("Program.il"); }
private static void CompileLibrary() { IL.Program prog; if (Input == null) { prog = Frontend.Core.CompileFromStdin(); } else { prog = Frontend.Core.CompileFromFile(Input); } prog.Main.Name = "LibMain"; var optProg = Optimization.DummyOptimization.Optimize(prog); var cilProg = new CIL.Program(optProg); var sw = new System.IO.StreamWriter("Library.il"); cilProg.Emit(sw, CIL.EmissionType.Library); sw.Close(); Assembler.Assembler.Invoke("Library.il"); }