示例#1
0
 public DesignatorVisitor(
     ILogger logger, Dafny.Program program, IDictionary <AstElement, ILocalizableSymbol> declarations, ISymbol rootScope, CancellationToken cancellationToken
     )
 {
     _logger            = logger;
     _program           = program;
     _declarations      = declarations;
     _typeResolver      = new DafnyLangTypeResolver(declarations);
     _currentScope      = rootScope;
     _cancellationToken = cancellationToken;
 }
示例#2
0
        public SymbolTable(
            CompilationUnit compilationUnit,
            IDictionary <AstElement, ILocalizableSymbol> declarations,
            IDictionary <ISymbol, SymbolLocation> locations,
            IIntervalTree <Position, ILocalizableSymbol> lookupTree,
            bool symbolsResolved
            )
        {
            CompilationUnit = compilationUnit;
            Declarations    = declarations;
            Locations       = locations;
            LookupTree      = lookupTree;
            Resolved        = symbolsResolved;
            typeResolver    = new DafnyLangTypeResolver(declarations);

            // TODO IntervalTree goes out of sync after any change and "fixes" its state upon the first query. Replace it with another implementation that can be queried without potential side-effects.
            LookupTree.Query(new Position(0, 0));
        }