示例#1
0
 public SymbolTable(SymbolTable theParentScope)
 {
     parentScope = theParentScope;
     theVariableTable = new Dictionary<string, Symbol>();
     theMethodTable = new Dictionary<string, Symbol>();
     theStructDeclTable = new Dictionary<string, Symbol>();
 }
示例#2
0
 /// <summary>
 /// Initializes a new scopemanager instance
 /// </summary>
 public ScopeManager(SymbolTable theCurrentScope)
 {
     currentScope = theCurrentScope;
 }
示例#3
0
 /// <summary>
 /// Initializes a new scope manager instance
 /// </summary>
 public ScopeManager()
 {
     currentScope = new SymbolTable();
 }
示例#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);
 }
示例#5
0
 /// <summary>
 /// Gets and pops the current scope
 /// </summary>
 /// <returns>The current scope</returns>
 internal SymbolTable GetAndExitScope()
 {
     currentScope = currentScope.getEnclosingScope();
     return currentScope;
 }
示例#6
0
 /// <summary>
 /// Creates a new scope and sets it as the current scope
 /// </summary>
 internal void EnterScope()
 {
     currentScope = new SymbolTable(currentScope);
 }