compiler.intermediate
Class Variable

java.lang.Object
  extended by compiler.intermediate.Variable
All Implemented Interfaces:
OperandIF

public class Variable
extends java.lang.Object
implements OperandIF

Clase que representa una variable en el código intermedio


Constructor Summary
Variable(java.lang.String name)
          Constructor for Variable.
Variable(java.lang.String name, ScopeIF scope)
          Constructor for Variable.
 
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.
 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.
 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

Variable

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

Parameters:
name - The name.

Variable

public Variable(java.lang.String name,
                ScopeIF scope)
Constructor for Variable.

Parameters:
name - The name.
scope - The scope index.
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.

Returns:
Returns the name.

getScope

public ScopeIF getScope()
Returns the scope.

Returns:
Returns the scope.

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.

Parameters:
name - The name to set.

setScope

public void setScope(ScopeIF scope)
Sets The scope.

Parameters:
scope - The scope 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.