edu.cmu.cs.crystal.tac
Interface ITACFlowAnalysis<LE>

All Superinterfaces:
IFlowAnalysis<LE>
All Known Implementing Classes:
SimpleTACFlowAnalysis, TACFlowAnalysis

public interface ITACFlowAnalysis<LE>
extends IFlowAnalysis<LE>

This interface defines methods to map AST data structures to TAC variables. These methods can for instance be used by TAC analysis transfer functions. NEB: This used to be called ITACAnalysisContext, but I renamed it and added a common method getNode which was not previously part of this interface.

Author:
Kevin Bierhoff, Nels Beckman
See Also:
ITACTransferFunction, ITACBranchSensitiveTransferFunction

Method Summary
 ThisVariable getImplicitThisVariable(IBinding accessedElement)
          Returns the implicit this variable for accessing a given method or field after previously analyzing the method surrounding the access. It is the caller's responsibility to make sure to call this method only when analysis results for the method surrounding the access are available.
 IResult<LE> getLabeledResultsAfter(TACInstruction instr)
          Retrieves the analysis state that exists after analyzing the instruction.
 IResult<LE> getLabeledResultsBefore(TACInstruction instr)
          Retrieves the analysis state that exists before analyzing the instruction.
 ASTNode getNode(Variable x, TACInstruction instruction)
          Returns for error-reporting purposes a AST node that surrounds or is represented by a variable mentioned in a given instruction.
 LE getResultsAfter(TACInstruction instr)
          Retrieves the analysis state that exists after analyzing the instruction.
 LE getResultsBefore(TACInstruction instr)
          Retrieves the analysis state that exists before analyzing the instruction.
 SourceVariable getSourceVariable(IVariableBinding varBinding)
          Returns the variable for a given parameter or local after previously analyzing the method declaring the parameter or local. It is the caller's responsibility to make sure to call this method only when analysis results for the declaring method are available.
 ThisVariable getThisVariable(MethodDeclaration methodDecl)
          Returns the this variable for a given method after previously analyzing that method. It is the caller's responsibility to make sure to call this method only when analysis results for the given method are available.
 Variable getVariable(ASTNode node)
          Returns the TAC variable for a given ASTNode after previously analyzing the method surrounding the given node. It is the caller's responsibility to make sure to call this method only when analysis results for the surrounding method are available.
 
Methods inherited from interface edu.cmu.cs.crystal.flow.IFlowAnalysis
getEndResults, getLabeledEndResult, getLabeledResultsAfter, getLabeledResultsBefore, getLabeledStartResult, getResultsAfter, getResultsAfterAST, getResultsAfterCFG, getResultsBefore, getResultsBeforeAST, getResultsBeforeCFG, getStartResults
 

Method Detail

getResultsBefore

LE getResultsBefore(TACInstruction instr)
Retrieves the analysis state that exists before analyzing the instruction. Before is respective to normal program flow and not the direction of the analysis.

Parameters:
instr - the TACInstruction of interest
Returns:
the lattice that represents the analysis state before analyzing the instruction. Or null if the node doesn't have a corresponding control flow node.

getResultsAfter

LE getResultsAfter(TACInstruction instr)
Retrieves the analysis state that exists after analyzing the instruction. After is respective to normal program flow and not the direction of the analysis.

Parameters:
instr - the TACInstruction of interest
Returns:
the lattice that represents the analysis state before analyzing the instruction. Or null if the node doesn't have a corresponding control flow node.

getLabeledResultsBefore

IResult<LE> getLabeledResultsBefore(TACInstruction instr)
Retrieves the analysis state that exists before analyzing the instruction. Before is respective to normal program flow and not the direction of the analysis.

Parameters:
instr - the TACInstruction of interest
Returns:
the lattice that represents the analysis state after analyzing the instruction. Or null if the node doesn't have a corresponding control flow node.

getLabeledResultsAfter

IResult<LE> getLabeledResultsAfter(TACInstruction instr)
Retrieves the analysis state that exists after analyzing the instruction. After is respective to normal program flow and not the direction of the analysis.

Parameters:
instr - the TACInstruction of interest
Returns:
the lattice that represents the analysis state after analyzing the instruction. Or null if the node doesn't have a corresponding control flow node.

getVariable

Variable getVariable(ASTNode node)
Returns the TAC variable for a given ASTNode after previously analyzing the method surrounding the given node. It is the caller's responsibility to make sure to call this method only when analysis results for the surrounding method are available.

Parameters:
node - AST node in the previously analyzed method.
Returns:
The TAC variable for a given ASTNode.

getThisVariable

ThisVariable getThisVariable(MethodDeclaration methodDecl)
Returns the this variable for a given method after previously analyzing that method. It is the caller's responsibility to make sure to call this method only when analysis results for the given method are available.

Parameters:
methodDecl - The method for which this is requested.
Returns:
The this variable for the given method.

getImplicitThisVariable

ThisVariable getImplicitThisVariable(IBinding accessedElement)
Returns the implicit this variable for accessing a given method or field after previously analyzing the method surrounding the access. It is the caller's responsibility to make sure to call this method only when analysis results for the method surrounding the access are available.

Parameters:
accessedElement -
Returns:
the implicit this for the accessed element

getSourceVariable

SourceVariable getSourceVariable(IVariableBinding varBinding)
Returns the variable for a given parameter or local after previously analyzing the method declaring the parameter or local. It is the caller's responsibility to make sure to call this method only when analysis results for the declaring method are available.

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

getNode

ASTNode getNode(Variable x,
                TACInstruction instruction)
Returns for error-reporting purposes a AST node that surrounds or is represented by a variable mentioned in a given instruction.

Parameters:
x - A variable.
instruction - Instruction that mentions x
Returns:
A AST node that surrounds or is represented by a variable mentioned in a given instruction.