예제 #1
0
파일: Program.cs 프로젝트: shravanrn/Cleps
        static int Main(string[] args)
        {
            CommandLineParameters programParams = ParseParameters(args);

            if (!ValidateFilesExists(programParams.Files))
            {
                return(-2);
            }

            CompilerDriver driver = new CompilerDriver(programParams);
            CompileStatus  status = driver.CompileFiles();

            if (status.Success)
            {
                Console.WriteLine("Built successfully");
            }
            else
            {
                Console.WriteLine("Error building");
                Console.WriteLine(String.Join("\n",
                                              status.Errors.Select(e => String.Format("File: {0} Line:{1} Column:{2} {3}", e.ErrorSourceFile, e.ErrorLineNumber, e.ErrorPositionInLine, e.ErrorMessage))
                                              ));
            }

            Console.ReadLine();
            return(0);
        }
예제 #2
0
파일: Program.cs 프로젝트: shravanrn/Cleps
        static int Main(string[] args)
        {
            ProgramParameters programParams = ParseParameters(args);
            if(!ValidateFilesExists(programParams.Files))
            {
                return -2;
            }

            CompilerDriver driver = new CompilerDriver(programParams.Files, "Test.ll");
            CompileStatus status = driver.CompileFiles();

            if(status.Success)
            {
                Console.WriteLine("Built successfully");
            }
            else
            {
                Console.WriteLine("Error building");
                Console.WriteLine(String.Join("\n", 
                    status.Errors.Select(e => String.Format("File: {0} Line:{1} Column:{2} {3}", e.ErrorSourceFile, e.ErrorLineNumber, e.ErrorPositionInLine, e.ErrorMessage))
                ));
            }

            Console.ReadLine();
            return 0;
        }