edu.cmu.cs.crystal.tac
Interface ITACAnalysisContext


public interface ITACAnalysisContext

This interface defines methods to map AST data structures to TAC variables. These methods can for instance be used by TAC analysis transfer functions.

Author:
Kevin Bierhoff
See Also:
ITACTransferFunction, ITACBranchSensitiveTransferFunction

Method Summary
 MethodDeclaration getAnalyzedMethod()
           
 SourceVariable getSourceVariable(IVariableBinding varBinding)
          Returns the variable for a given parameter or local.
 SuperVariable getSuperVariable()
          Returns the super variable for the analyzed method, if any.
 ThisVariable getThisVariable()
          Returns the this variable for the analyzed method.
 Variable getVariable(ASTNode node)
          Returns the TAC variable for a given ASTNode.
 

Method Detail

getVariable

Variable getVariable(ASTNode node)
Returns the TAC variable for a given ASTNode. This ASTNode must represent something where there is a resulting variable, for example, a SingleVariableDeclaration will not have a variable as it has no "result". It is the caller's responsibility to make sure to call this method only while the method surrounding the given node is analyzed.

Parameters:
node - AST node in the previously analyzed method.
Returns:
The TAC variable for a given ASTNode, or null if this ASTNode has no result.

getThisVariable

ThisVariable getThisVariable()
Returns the this variable for the analyzed method. Returns null if we are analyzing a static method.

Returns:
The this variable for the analyzed method.

getSuperVariable

SuperVariable getSuperVariable()
Returns the super variable for the analyzed method, if any.

Returns:
the super variable for the analyzed method or null if it doesn't exist.

getSourceVariable

SourceVariable getSourceVariable(IVariableBinding varBinding)
Returns the variable for a given parameter or local. It is the caller's responsibility to make sure to call this method only while the method declaring the parameter or local is analyzed.

Parameters:
varBinding - Binding of a local or parameter.
Returns:
the variable for the given parameter or local.

getAnalyzedMethod

MethodDeclaration getAnalyzedMethod()