private static string BuildAndRun(string filePath) { ILLanguage backend = new CecilBackendLanguage(filePath); using (var interpreter = new Interpreter <ILLanguage>(backend)) using (var source = new StreamReader(filePath)) { if (!interpreter.Parse(source, filePath)) { throw new AssertionException("Parsing of file " + filePath + " failed!"); } } backend.Save(); return(ProgramExecutor.Execute(Path.GetFileNameWithoutExtension(filePath) + ".exe")); }
private static string BuildAndRun(string filePath) { ILLanguage backend = new CecilBackendLanguage(filePath); using (var interpreter = new Interpreter<ILLanguage>(backend)) using (var source = new StreamReader(filePath)) { if (!interpreter.Parse(source, filePath)) { throw new AssertionException("Parsing of file " + filePath + " failed!"); } } backend.Save(); return ProgramExecutor.Execute(Path.GetFileNameWithoutExtension(filePath) + ".exe"); }