Ejemplo n.º 1
0
        bool ParseAndTypeCheck()
        {
            Dafny.ModuleDecl module      = new Dafny.LiteralModuleDecl(new Dafny.DefaultModuleDecl(), null);
            Dafny.BuiltIns   builtIns    = new Dafny.BuiltIns();
            Dafny.Errors     parseErrors = new VSErrors(this);
            int    errorCount            = Dafny.Parser.Parse(_snapshot.GetText(), _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);

            var r = new VSResolver(program, this);

            r.ResolveProgram(program);
            if (r.ErrorCount != 0)
            {
                return(false);
            }

            program.AdditionalInformation.AddRange(r.AdditionalInformation);
            _program = program;
            return(true); // success
        }
Ejemplo n.º 2
0
    bool ParseAndTypeCheck() {
      Dafny.ModuleDecl module = new Dafny.LiteralModuleDecl(new Dafny.DefaultModuleDecl(), null);
      Dafny.BuiltIns builtIns = new Dafny.BuiltIns();
      Dafny.Errors parseErrors = new VSErrors(this);
      int errorCount = Dafny.Parser.Parse(_snapshot.GetText(), _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);

      var r = new VSResolver(program, this);
      r.ResolveProgram(program);
      if (r.ErrorCount != 0)
        return false;

      program.AdditionalInformation.AddRange(r.AdditionalInformation);
      _program = program;
      return true;  // success
    }