示例#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"));
        }
示例#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");
        }