es.uned.compiler.semantic.symbol
Class SymbolBase

java.lang.Object
  extended by es.uned.compiler.semantic.symbol.SymbolBase
All Implemented Interfaces:
SymbolIF
Direct Known Subclasses:
SymbolConstant, SymbolFunction, SymbolParameter, SymbolProcedure, SymbolVariable

public abstract class SymbolBase
extends java.lang.Object
implements SymbolIF

Clase de la que deben heredar todos los objetos que almacene la tabla de símbolos


Constructor Summary
SymbolBase(ScopeIF scope, java.lang.String name, TypeIF type)
          Constructor for SymbolBase.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compares this object with another one.
 java.lang.String getName()
          Returns the name.
 ScopeIF getScope()
          Returns the scope.
 TypeIF getType()
          Returns the type.
 int hashCode()
          Returns a hash code for the object.
 void setName(java.lang.String name)
          Sets The name.
 void setScope(ScopeIF scope)
          Sets The scope.
 void setType(TypeIF type)
          Sets The type.
 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

SymbolBase

public SymbolBase(ScopeIF scope,
                  java.lang.String name,
                  TypeIF type)
Constructor for SymbolBase.

Parameters:
scope - The symbol scope.
name - The symbol name.
type - The symbol type.
Method Detail

equals

public boolean equals(java.lang.Object other)
Compares this object with another one.

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

getName

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

Specified by:
getName in interface SymbolIF
Returns:
Returns the name.

getScope

public ScopeIF getScope()
Returns the scope.

Specified by:
getScope in interface SymbolIF
Returns:
Returns the scope.

getType

public TypeIF getType()
Returns the type.

Specified by:
getType in interface SymbolIF
Returns:
Returns the type.

hashCode

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

Overrides:
hashCode in class java.lang.Object

setName

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

Specified by:
setName in interface SymbolIF
Parameters:
name - The name to set.

setScope

public void setScope(ScopeIF scope)
Sets The scope.

Specified by:
setScope in interface SymbolIF
Parameters:
scope - The scope to set.

setType

public void setType(TypeIF type)
Sets The type.

Specified by:
setType in interface SymbolIF
Parameters:
type - The type 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.