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


C# Resolver.ResolveProgram方法代码示例

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


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

示例1: ReParse

    public Program ReParse(bool runResolver)
    {
      var errorReporter = new ConsoleErrorReporter();
      var module = new LiteralModuleDecl(new DefaultModuleDecl(), null);
      var builtIns = new BuiltIns();
      var parseErrors = new Errors(errorReporter);
      var errorCount = Parser.Parse(_snapshot.GetText(), _filename, _filename, module, builtIns, parseErrors);
      var errString = Main.ParseIncludes(module, builtIns, new List<string>(), parseErrors);
      if (errorCount != 0 || errString != null) return null;

      var program = new Program(_filename, module, builtIns, errorReporter);
      if (!runResolver) return program;

      var r = new Resolver(program);
      r.ResolveProgram(program);
      return errorReporter.Count(ErrorLevel.Error) == 0 ? program : null;
    }
开发者ID:ggrov,项目名称:tacny,代码行数:17,代码来源:TacnyDriver.cs

示例2: ParseAndTypeCheck

        bool ParseAndTypeCheck(bool runResolver)
        {
            Tuple<ITextSnapshot, Dafny.Program, List<DafnyError>> parseResult;
              Dafny.Program program;
              var errorReporter = new VSErrorReporter(this);
              if (_buffer.Properties.TryGetProperty(bufferDafnyKey, out parseResult) &&
             (parseResult.Item1 == _snapshot)) {
            // already parsed;
            program = parseResult.Item2;
            _errors = parseResult.Item3;
            if (program == null)
              runResolver = false;
              } else {
            Dafny.ModuleDecl module = new Dafny.LiteralModuleDecl(new Dafny.DefaultModuleDecl(), null);
            Dafny.BuiltIns builtIns = new Dafny.BuiltIns();
            var parseErrors = new Dafny.Errors(errorReporter);
            int errorCount = Dafny.Parser.Parse(_snapshot.GetText(), _filename, _filename, module, builtIns, parseErrors);
            string errString = Dafny.Main.ParseIncludes(module, builtIns, new List<string>(), parseErrors);

            if (errorCount != 0 || errString != null) {
              runResolver = false;
              program = null;
            } else {
              program = new Dafny.Program(_filename, module, builtIns, errorReporter);
            }
            _buffer.Properties[bufferDafnyKey] = new Tuple<ITextSnapshot, Dafny.Program, List<DafnyError>>(_snapshot, program, _errors);
              }
              if (!runResolver) {
            return false;
              }

              var r = new Resolver(program);
              r.ResolveProgram(program);
              if (errorReporter.Count(ErrorLevel.Error) != 0)
            return false;

              _program = program;
              return true;  // success
        }
开发者ID:Chris-Hawblitzel,项目名称:dafny,代码行数:39,代码来源:DafnyDriver.cs

示例3: ParseAndTypeCheck

        bool ParseAndTypeCheck()
        {
            Dafny.ModuleDecl module = new Dafny.LiteralModuleDecl(new Dafny.DefaultModuleDecl(), null);
              Dafny.BuiltIns builtIns = new Dafny.BuiltIns();

              var errorReporter = new VSErrorReporter(this);
              var parseErrors = new Dafny.Errors(errorReporter);

              int errorCount = Dafny.Parser.Parse(_snapshot.GetText(), _filename, _filename, module, builtIns, parseErrors);
              string errString = Dafny.Main.ParseIncludes(module, builtIns, new List<string>(), parseErrors);
              if (errorCount != 0 || errString != null)
            return false;
              Dafny.Program program = new Dafny.Program(_filename, module, builtIns, errorReporter);

              var r = new Resolver(program);
              r.ResolveProgram(program);
              if (errorReporter.Count(ErrorLevel.Error) != 0)
            return false;

              _program = program;
              return true;  // success
        }
开发者ID:dbremner,项目名称:dafny,代码行数:22,代码来源:DafnyDriver.cs


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