|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.cs.crystal.tac.model.Variable
edu.cmu.cs.crystal.tac.model.SourceVariable
public class SourceVariable
A source variable is a variable in three address code that actually existed in
the original Java source code. Most of the variables that appear in three
address code are temporary variables that exist solely for the purpose of
storing intermediate sub-expression values. However, variables that originally
existed in source code are translated as variables of this type.
For example, in the following excerpt:
int a = 4+5+3+6+9+2+9;
each of the additions on the right-hand side will be turned into a temporary variable
assignment, but the variable 'a' will exist as an instance of this class.
Constructor Summary | |
---|---|
SourceVariable(String id,
IVariableBinding binding,
boolean isLocallyDeclared)
Creates a new source variable object for a local with the given name and binding. |
Method Summary | ||
---|---|---|
|
dispatch(IVariableVisitor<T> visitor)
|
|
boolean |
equals(Object obj)
|
|
IVariableBinding |
getBinding()
We can get the original java source binding. |
|
int |
hashCode()
|
|
boolean |
isCapturedFromOuterScope()
Indicates whether this source variable is captured from an outer scope. |
|
ITypeBinding |
resolveType()
null or the type binding of this variable. |
|
String |
toString()
|
Methods inherited from class edu.cmu.cs.crystal.tac.model.Variable |
---|
getSourceString, isUnqualifiedSuper, isUnqualifiedThis |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SourceVariable(String id, IVariableBinding binding, boolean isLocallyDeclared)
id
- binding
- isLocallyDeclared
- pass true
for locally declared variables,
including formal parameters, false
for variables captured from an outer scope.Method Detail |
---|
public IVariableBinding getBinding()
public boolean isCapturedFromOuterScope()
true
if this source variable is captured from an outer scope,
false
otherwise.public <T> T dispatch(IVariableVisitor<T> visitor)
dispatch
in class Variable
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public ITypeBinding resolveType()
Variable
null
or the type binding of this variable.
resolveType
in class Variable
Expression.resolveTypeBinding()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |