es.uned.compiler.semantic.symbol
Interface ScopeManagerIF

All Known Implementing Classes:
ScopeManager

public interface ScopeManagerIF

Interfaz para el gestor de ámbitos (ScopeManager).


Method Summary
 boolean containsSymbol(java.lang.String name)
          Indicates whether a symbol is contained witin the scope stack.
 boolean containsSymbol(SymbolIF symbol)
          Indicates whether a symbol is contained witin the scope stack.
 Scope createScope(java.lang.String name)
          Creates a new scope and adds it to the scope stack.
 java.util.List getAllScopes()
          Returns all scopes witin created during the compilation process.
 java.util.List getCurrentScopes()
          Returns all scopes witin the stack.
 ScopeIF getParentScope()
          Returns the parent scope.
 ScopeIF getScope()
          Returns the current scope.
 ScopeIF getScope(int index)
          Returns a scope.
 void releaseScope()
          Release the current scope dropping from the scope stack.
 SymbolIF searchSymbol(java.lang.String name)
          Looks up a symbol accross all scopes within the stack.
 

Method Detail

containsSymbol

boolean containsSymbol(java.lang.String name)
Indicates whether a symbol is contained witin the scope stack.

Parameters:
name - The symbol name to search.
Returns:
True if the symbol is contained witin the scope stack.

containsSymbol

boolean containsSymbol(SymbolIF symbol)
Indicates whether a symbol is contained witin the scope stack.

Parameters:
symbol - The symbol to search.
Returns:
True if the symbol is contained witin the scope stack.

createScope

Scope createScope(java.lang.String name)
Creates a new scope and adds it to the scope stack.

Parameters:
name - the mame token that opens the scope.
Returns:
A new scope.

getAllScopes

java.util.List getAllScopes()
Returns all scopes witin created during the compilation process.

Returns:
A list of ordered scopes.

getCurrentScopes

java.util.List getCurrentScopes()
Returns all scopes witin the stack.

Returns:
A list of ordered scopes.

getParentScope

ScopeIF getParentScope()
Returns the parent scope.

Returns:
A scope.

getScope

ScopeIF getScope()
Returns the current scope.

Returns:
The current scope.

getScope

ScopeIF getScope(int index)
Returns a scope.

Parameters:
index - The index of the scope within the scope stack.
Returns:
A scope.

releaseScope

void releaseScope()
Release the current scope dropping from the scope stack.


searchSymbol

SymbolIF searchSymbol(java.lang.String name)
Looks up a symbol accross all scopes within the stack. The search process start from the top of the stack and go deep through the stack up to reach the base.

Parameters:
name - The sumbol name.
Returns:
A symbol or null if it does not exist in the stack.