public SymbolTable GenerateSymTable(RootScopeAST rootAST, string fileName) { _symTable = new SymbolTable(); _symTable.FilePath = fileName; _symTable.FileDependencies = rootAST.FileDependencies; _symTable.IdentInfoDictionary = new Dictionary <IdentifierLocation, IdentifierInfo>(); _symTable.TypeInfoDictionary = new Dictionary <string, CustomTypeInfo>(); _symTable.ScopeInfoDictionary = new Dictionary <int, ScopeInfo>(); GlobalIdentifiers = new List <string>(); GlobalTypes = new List <string>(); IdentifiersToBeInferred = new List <IdentExpr>(); rootAST.Accept(this); _currentNodePosition = 0; _currentScope = null; _scopeIdGen = 0; return(_symTable); }
public override void Visit(RootScopeAST rootScope) { _currentScopeId = _scopeIdGen; foreach (var element in rootScope.elements) { _currentNodePosition++; element.Accept(this); } }
public override void Visit(RootScopeAST rootScope) { _currentScope = new ScopeInfo { id = _scopeIdGen, parent = null }; _symTable.ScopeInfoDictionary.Add(_currentScope.id, _currentScope); foreach (var element in rootScope.elements) { _currentNodePosition++; element.Accept(this); } }
public virtual void Visit(RootScopeAST rootScope) { }