edu.cmu.cs.crystal.tac.model
Class TempVariable

java.lang.Object
  extended by edu.cmu.cs.crystal.tac.model.Variable
      extended by edu.cmu.cs.crystal.tac.model.TempVariable

public class TempVariable
extends Variable

Temporary variables created during the course of translating to three address code are represented by instances of this class. All sub-expressions in a normal Java expression have their value assigned to a temporary variable and those variables are represented by instance of this class. For instance, the following Java expression:
a = 3 + 4
would actually be represented by three address code that looks something like the following:
x = 3;
y = 4;
a = x + y;
Those variables that are created for the purpose of evaluating sub-expressions (here x and y) are temporary variables, and represented by instance of this class.

Author:
Kevin Bierhoff

Constructor Summary
TempVariable(ASTNode node)
           
 
Method Summary
<T> T
dispatch(IVariableVisitor<T> visitor)
           
 boolean equals(Object obj)
           
 ASTNode getNode()
           
 String getSourceString()
          Returns a string representing this variable in the source.
 int hashCode()
           
 ITypeBinding resolveType()
          null or the type binding of this variable.
 String toString()
           
 
Methods inherited from class edu.cmu.cs.crystal.tac.model.Variable
isUnqualifiedSuper, isUnqualifiedThis
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TempVariable

public TempVariable(ASTNode node)
Method Detail

getNode

public ASTNode getNode()

dispatch

public <T> T dispatch(IVariableVisitor<T> visitor)
Specified by:
dispatch in class Variable

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

getSourceString

public String getSourceString()
Description copied from class: Variable
Returns a string representing this variable in the source.

Overrides:
getSourceString in class Variable
Returns:
String representing this variable in the source.

resolveType

public ITypeBinding resolveType()
Description copied from class: Variable
null or the type binding of this variable.

Specified by:
resolveType in class Variable
See Also:
Expression.resolveTypeBinding()