コード例 #1
0
ファイル: VccPlugin.cs プロジェクト: edgar-pek/VCDryad
 public ErrorReporter(VccOptions opts, string name, IToken tok, double startTime, VerificationErrorHandler errorHandler)
 {
     this.name = name;
       this.startTime = startTime;
       this.prevTime = VccCommandLineHost.GetTime();
       this.commandLineOptions = opts;
       this.proverWarnings = new List<string>();
       this.errorHandler = errorHandler;
       this.tok = tok;
 }
コード例 #2
0
ファイル: VccPlugin.cs プロジェクト: tupipa/vcc
 public ErrorReporter(VccOptions opts, string name, IToken tok, double startTime, VerificationErrorHandler errorHandler)
 {
     this.name               = name;
     this.startTime          = startTime;
     this.prevTime           = VccCommandLineHost.GetTime();
     this.commandLineOptions = opts;
     this.proverWarnings     = new List <string>();
     this.errorHandler       = errorHandler;
     this.tok = tok;
 }
コード例 #3
0
ファイル: Host.cs プロジェクト: tupipa/vcc
        public static int Main(string[] args)
        {
            swTotal.Start();

            // reference symbol from Z3 so it gets copied
#pragma warning disable 168
            var y = new Microsoft.Boogie.SMTLib.Factory();
#pragma warning restore 168

            Logger.Instance.Register(ConsoleLogger.Instance);

            try
            {
                startTime                    = GetTime();
                cciErrorHandler              = new CciErrorHandler();
                dummyHostEnvironment.Errors += cciErrorHandler.HandleErrors;
                var commandLineOptions = OptionParser.ParseCommandLineArguments(dummyHostEnvironment, args);
                commandLineOptions.RunningFromCommandLine = true;
                cciErrorHandler.CommandLineOptions        = commandLineOptions;
                verificationErrorHandler = new VerificationErrorHandler(commandLineOptions);

                if (commandLineOptions.DisplayCommandLineHelp)
                {
                    DisplayCommandLineHelp();
                    return(0);
                }

                if (commandLineOptions.DisplayVersion)
                {
                    DisplayVersion();
                    return(0);
                }

                if (errorCount > 0 || fileErrorCount > 0)
                {
                    Console.Error.WriteLine("Exiting with 1 - error parsing arguments.");
                    return(1);
                }

                if (commandLineOptions.RunTestSuite)
                {
                    Logger.Instance.Unregister(ConsoleLogger.Instance);
                    Logger.Instance.Register(new ConsoleLoggerForTestRun());
                }

                if (!String.IsNullOrEmpty(commandLineOptions.XmlLogFile))
                {
                    Stream xmlStream = File.Open(commandLineOptions.XmlLogFile, FileMode.Create, FileAccess.Write);
                    Logger.Instance.Register(new XmlLogger(xmlStream));
                }

                if ((currentPlugin = InitializePlugin(commandLineOptions)) == null)
                {
                    Logger.Instance.Log("Exiting with 2 - error initializing plugin.");
                    return(2);
                }

                if (commandLineOptions.RunTestSuite)
                {
                    errorCount = TestRunner.RunTestSuite(commandLineOptions);
                }
                else
                {
                    RunPlugin(commandLineOptions);
                }

                swTotal.Stop();

                DumpTimes(commandLineOptions);

                int retVal = 0;

                if (errorCount > 0)
                {
                    Logger.Instance.Error("Exiting with 3 ({0} error(s).)", errorCount);
                    retVal = 3;
                }

                return(retVal);
            }
            finally
            {
                Logger.Instance.Dispose();
            }
        }
コード例 #4
0
ファイル: ErrorHandler.cs プロジェクト: edgar-pek/VCDryad
        private bool ReportError(IToken tok, VerificationErrorHandler.ErrorCode code, string fmt, params string[] args)
        {
            Logger.Instance.LogWithLocation(
            ErrorCodeToString(code),
            Format(fmt, args),
            tok.ToLocation(),
            LogKind.Error,
            false
              );

              return true;
        }
コード例 #5
0
ファイル: ErrorHandler.cs プロジェクト: edgar-pek/VCDryad
 private static bool IsStandaloneError(VerificationErrorHandler.ErrorCode num)
 {
     return (int)num >= 8000 && (int)num < 8500;
 }
コード例 #6
0
ファイル: Host.cs プロジェクト: edgar-pek/VCDryad
        public static int Main(string[] args)
        {
            Console.WriteLine("VCDryad ...");
              swTotal.Start();

              // reference symbol from Z3 so it gets copied
            #pragma warning disable 168
              var y = new Microsoft.Boogie.SMTLib.Factory();
            #pragma warning restore 168

              Logger.Instance.Register(ConsoleLogger.Instance);

              try
              {

              startTime = GetTime();
              cciErrorHandler = new CciErrorHandler();
              dummyHostEnvironment.Errors += cciErrorHandler.HandleErrors;
              var commandLineOptions = OptionParser.ParseCommandLineArguments(dummyHostEnvironment, args);
              commandLineOptions.RunningFromCommandLine = true;
              cciErrorHandler.CommandLineOptions = commandLineOptions;
              verificationErrorHandler = new VerificationErrorHandler(commandLineOptions);

              if (commandLineOptions.DisplayCommandLineHelp)
              {
              DisplayCommandLineHelp();
              return 0;
              }

              if (commandLineOptions.DisplayVersion)
              {
              DisplayVersion();
              return 0;
              }

              if (errorCount > 0 || fileErrorCount > 0)
              {
              Console.Error.WriteLine("Exiting with 1 - error parsing arguments.");
              return 1;
              }

              if (commandLineOptions.RunTestSuite) {
            Logger.Instance.Unregister(ConsoleLogger.Instance);
            Logger.Instance.Register(new ConsoleLoggerForTestRun());
              }

              if (!String.IsNullOrEmpty(commandLineOptions.XmlLogFile)) {
              Stream xmlStream = File.Open(commandLineOptions.XmlLogFile, FileMode.Create, FileAccess.Write);
              Logger.Instance.Register(new XmlLogger(xmlStream));
              }

              //Console.WriteLine("Initializing Dryad plugin ...");
              if ((currentPlugin = InitializePlugin(commandLineOptions)) == null)
              {
              Console.WriteLine("inside init plugin...");
              Logger.Instance.Log("Exiting with 2 - error initializing plugin.");
              return 2;
              }
              //Console.WriteLine("Done.");

              if (commandLineOptions.RunTestSuite)
              errorCount = TestRunner.RunTestSuite(commandLineOptions);
              else
              RunPlugin(commandLineOptions);

              swTotal.Stop();

              DumpTimes(commandLineOptions);

              int retVal = 0;

              if (errorCount > 0)
              {
              Logger.Instance.Error("Exiting with 3 ({0} error(s).)", errorCount);
              retVal = 3;
              }
              Console.WriteLine("VCDryad done.");
              return retVal;

              }
              finally
              {
              Logger.Instance.Dispose();
              }
        }