当前位置: 首页>>代码示例>>C#>>正文


C# Program.ResolveProgram方法代码示例

本文整理汇总了C#中Program.ResolveProgram方法的典型用法代码示例。如果您正苦于以下问题:C# Program.ResolveProgram方法的具体用法?C# Program.ResolveProgram怎么用?C# Program.ResolveProgram使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Program的用法示例。


在下文中一共展示了Program.ResolveProgram方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessFiles

    /// <summary>
    /// Processes the file
    /// </summary>
    /// <param name="fileNames"></param>
    /// <param name="programId"></param>
    /// <returns></returns>
    static ExitValue ProcessFiles(IList<string/*!*/>/*!*/ fileNames, string programId = null) {
      //Contract.Requires(Tacny.tcce.NonNullElements(fileNames));

      if (programId == null) {
        programId = fileNames[0];
      }

      var exitValue = ExitValue.Verified;
      if (CommandLineOptions.Clo.VerifySeparately && 1 < fileNames.Count) {
        foreach (string f in fileNames) {
          Console.WriteLine();
          Console.WriteLine($"-------------------- {f} --------------------");
          var ev = ProcessFiles(new List<string> { f }, f);
          if (exitValue != ev && ev != ExitValue.Verified) {
            exitValue = ev;
          }
        }
        return exitValue;
      }

      using (new XmlFileScope(CommandLineOptions.Clo.XmlSink, fileNames[fileNames.Count - 1])) {
        Program tacnyProgram;
        string programName = fileNames.Count == 1 ? fileNames[0] : "the program";
        // install Util.Printer
        try {
          Debug.WriteLine("Initializing Tacny Program");
          tacnyProgram = new Program(fileNames, programId);
          // Initialize the printer
          Printer.Install(fileNames[0]);
          tacnyProgram.MaybePrintProgram(tacnyProgram.DafnyProgram, programName + "_src");
        } catch (ArgumentException ex) {
          exitValue = ExitValue.DafnyError;
          _printer.ErrorWriteLine(Console.Out, ex.Message);
          return exitValue;
        }


        var program = tacnyProgram.ParseProgram();
        int qq = tacnyProgram.ResolveProgram(program);
        var md = Interpreter.FindAndApplyTactic(tacnyProgram.ParseProgram(), ((ClassDecl) program.DefaultModuleDef.TopLevelDecls[0]).Members[0], null);
        Printer.P.GetConsolePrinter().PrintMethod(md as Method, 0, false);


        if (!CommandLineOptions.Clo.NoResolve && !CommandLineOptions.Clo.NoTypecheck && DafnyOptions.O.DafnyVerify) {

          Debug.WriteLine("Starting lazy tactic evaluation");
          LazyTacny.Interpreter r = new LazyTacny.Interpreter(tacnyProgram);
          var prog = r.ResolveProgram();
          tacnyProgram.PrintProgram(prog);
          Debug.WriteLine("Fnished lazy tactic evaluation");
        }
        tacnyProgram.PrintAllDebugData(TacnyOptions.O.PrintCsv);
      }
      return exitValue;
    }
开发者ID:ggrov,项目名称:tacny,代码行数:61,代码来源:TacnyDriver.cs


注:本文中的Program.ResolveProgram方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。