public CompilerResults Compile() { var exitval = DafnyDriver.ProcessCommandLineArguments(CompilationArgs, out var dafnyFiles, out var otherFiles); if (!PerformPreliminaryChecks(exitval, out var errorneousCompileResults)) { return(errorneousCompileResults); } TextWriter tw = new StringWriter(); Type.ResetScopes(); int oldErrorCount = Dp.reporter.Count(ErrorLevel.Error); DafnyDriver.CompileDafnyProgram(Dp, Path, otherFiles.AsReadOnly(), true, tw); int newErrorCount = Dp.reporter.Count(ErrorLevel.Error); if (oldErrorCount != newErrorCount) { return(ExtractError(oldErrorCount)); } bool hasMain = new Microsoft.Dafny.CsharpCompiler(Dp.reporter).HasMain(Dp, out _); return(new CompilerResults { Error = false, Executable = hasMain, Message = tw.ToString().TrimEnd('\r', '\n') }); }
public Program getProgram(string filename) { Program dafnyProgram = null; List <DafnyFile> dafnyFiles; List <string> otherFiles; string[] args = new string[] { filename }; DafnyDriver.ProcessCommandLineArguments(args, out dafnyFiles, out otherFiles); ErrorReporter reporter = new ConsoleErrorReporter(); string s = Microsoft.Dafny.Main.ParseCheck(dafnyFiles, "", reporter, out dafnyProgram); return(dafnyProgram); }
public VSResolver(Dafny.Program program, DafnyDriver dd) : base(program) { this.dd = dd; AdditionalInformationReporter = (addinfo) => { if (!_additionalInformation.ContainsKey(addinfo.Token)) { _additionalInformation.Add(addinfo.Token, new HashSet<AdditionalInformation>()); } _additionalInformation[addinfo.Token].Add(addinfo); }; }
public VSErrorReporter(DafnyDriver dd) { this.dd = dd; }
public VSErrors(DafnyDriver dd) { this.dd = dd; }