es.uned.compiler.semantic.symbol
Class Scope

java.lang.Object
  extended by es.uned.compiler.semantic.symbol.Scope
All Implemented Interfaces:
ScopeIF

public class Scope
extends java.lang.Object
implements ScopeIF

Clase que implementa un ámbito. Al crearse un objeto de tipo Scope se crea también una tabla de símbolos asociada (SymbolTable) y una tabla de temporales (TemporalTable)


Constructor Summary
Scope(java.lang.String name)
          Constructor for Scope.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compares this object with another one.
 int getId()
          Returns the id.
 int getLevel()
          Returns the scope level.
 java.lang.String getName()
          Returns the scopeName.
 SymbolTableIF getSymbolTable()
          Returns the symbolTable.
 TemporalTableIF getTemporalTable()
          Returns the temporalTable.
 TypeTableIF getTypeTable()
          Returns the typeTable.
 int hashCode()
          Returns a hash code for the object.
 void setId(int id)
          Sets The id.
 void setLevel(int scope)
          Sets The scope level.
 void setName(java.lang.String scopeName)
          Sets The scopeName.
 void setSymbolTable(SymbolTableIF symbolTable)
          Sets The symbolTable.
 void setTemporalTable(TemporalTableIF temporalTable)
          Sets The temporalTable.
 void setTypeTable(TypeTableIF typeTable)
          Sets The typeTable.
 java.lang.String toString()
          Return a string representing the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Scope

public Scope(java.lang.String name)
Constructor for Scope.

Parameters:
the - name of the scope.
Method Detail

equals

public boolean equals(java.lang.Object other)
Compares this object with another one. Two Scopes are equals if all its atributes are equals

Overrides:
equals in class java.lang.Object
Parameters:
other - the other object.
Returns:
true if two objects has the same properties.

getId

public int getId()
Returns the id.

Specified by:
getId in interface ScopeIF
Returns:
Returns the id.

getLevel

public int getLevel()
Returns the scope level.

Specified by:
getLevel in interface ScopeIF
Returns:
Returns the scope level.

getName

public java.lang.String getName()
Returns the scopeName.

Specified by:
getName in interface ScopeIF
Returns:
Returns the scopeName.

getSymbolTable

public SymbolTableIF getSymbolTable()
Returns the symbolTable.

Specified by:
getSymbolTable in interface ScopeIF
Returns:
Returns the symbolTable.

getTemporalTable

public TemporalTableIF getTemporalTable()
Returns the temporalTable.

Specified by:
getTemporalTable in interface ScopeIF
Returns:
Returns the temporalTable.

getTypeTable

public TypeTableIF getTypeTable()
Returns the typeTable.

Returns:
Returns the typeTable.

hashCode

public int hashCode()
Returns a hash code for the object.

Overrides:
hashCode in class java.lang.Object

setId

public void setId(int id)
Sets The id.

Specified by:
setId in interface ScopeIF
Parameters:
id - The id to set.

setLevel

public void setLevel(int scope)
Sets The scope level.

Specified by:
setLevel in interface ScopeIF
Parameters:
scope - The scope level to set.

setName

public void setName(java.lang.String scopeName)
Sets The scopeName.

Specified by:
setName in interface ScopeIF
Parameters:
scopeName - The scopeName to set.

setSymbolTable

public void setSymbolTable(SymbolTableIF symbolTable)
Sets The symbolTable.

Specified by:
setSymbolTable in interface ScopeIF
Parameters:
symbolTable - The symbolTable to set.

setTemporalTable

public void setTemporalTable(TemporalTableIF temporalTable)
Sets The temporalTable.

Specified by:
setTemporalTable in interface ScopeIF
Parameters:
temporalTable - The temporalTable to set.

setTypeTable

public void setTypeTable(TypeTableIF typeTable)
Sets The typeTable.

Parameters:
typeTable - The typeTable to set.

toString

public java.lang.String toString()
Return a string representing the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representing the object.