Esempio n. 1
0
 public SymbolTable(SymbolTable theParentScope)
 {
     parentScope = theParentScope;
     theVariableTable = new Dictionary<string, Symbol>();
     theMethodTable = new Dictionary<string, Symbol>();
     theStructDeclTable = new Dictionary<string, Symbol>();
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new scopemanager instance
 /// </summary>
 public ScopeManager(SymbolTable theCurrentScope)
 {
     currentScope = theCurrentScope;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new scope manager instance
 /// </summary>
 public ScopeManager()
 {
     currentScope = new SymbolTable();
 }
Esempio n. 4
0
 /// <summary>
 /// Pushes a certain symboTable as the current scope.
 /// </summary>
 /// <param name="theTable"></param>
 internal void PushSymbolTable(SymbolTable theTable)
 {
     currentScope = new SymbolTable(theTable);
 }
Esempio n. 5
0
 /// <summary>
 /// Gets and pops the current scope
 /// </summary>
 /// <returns>The current scope</returns>
 internal SymbolTable GetAndExitScope()
 {
     currentScope = currentScope.getEnclosingScope();
     return currentScope;
 }
Esempio n. 6
0
 /// <summary>
 /// Creates a new scope and sets it as the current scope
 /// </summary>
 internal void EnterScope()
 {
     currentScope = new SymbolTable(currentScope);
 }