Beispiel #1
0
        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"));
        }
Beispiel #2
0
        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");
        }