Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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;
        }