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