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

All Superinterfaces:
IFlowAnalysis<LE>
All Known Implementing Classes:
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.
 ThisVariable getThisVariable(MethodDeclaration methodDecl)
          Returns the this variable for a given method.
 Variable getVariable(ASTNode node)
          Returns the TAC variable for a given ASTNode.
 
Methods inherited from interface edu.cmu.cs.crystal.flow.IFlowAnalysis
getEndResults, getLabeledEndResult, getLabeledResultsAfter, getLabeledResultsBefore, getLabeledStartResult, getResultsAfter, getResultsBefore, 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. 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.

getThisVariable

ThisVariable getThisVariable(MethodDeclaration methodDecl)
Returns the this variable for a given method. It is the caller's responsibility to make sure to call this method only while the given method is analyzed.

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 variable of the accessed element

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.

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.