edu.cmu.cs.crystal.tac.model
Class TempVariable
java.lang.Object
edu.cmu.cs.crystal.tac.model.Variable
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
TempVariable
public TempVariable(ASTNode node)
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()