edu.cmu.cs.crystal.tac.eclipse
Interface IEclipseVariableQuery

All Known Implementing Classes:
EclipseTAC

public interface IEclipseVariableQuery

Interface to query variables from the TAC infrastructure. Variables are lazily determined by most TAC classes, and this interface is used to do so.

Author:
Kevin Bierhoff
See Also:
EclipseTACInstructionFactory, TACInstruction, EclipseAbstractFieldAccess

Method Summary
 ThisVariable implicitThisVariable(IBinding accessedElement)
          Determines the implicit this variable for a method call or field access.
 SourceVariable sourceVariable(IVariableBinding binding)
          Determines the variable for the given parameter or local variable binding.
 SuperVariable superVariable(Name qualifier)
          Determines the super variable, taking a possible qualifier into account.
 ThisVariable thisVariable()
          Returns the this variable, if the surrounding method is an instance method.
 TypeVariable typeVariable(ITypeBinding binding)
          Determines the variable for a given type binding.
 Variable variable(ASTNode astNode)
          Returns the variable representing the result of evaluating the given AST node.
 

Method Detail

variable

Variable variable(ASTNode astNode)
Returns the variable representing the result of evaluating the given AST node.

Parameters:
astNode - Must be a node that evaluates to a value (usually an Expression.
Returns:
the variable representing the result of evaluating the given AST node.

sourceVariable

SourceVariable sourceVariable(IVariableBinding binding)
Determines the variable for the given parameter or local variable binding.

Parameters:
binding - Binding for a parameter or local variable.
Returns:
Variable for the given local variable binding.

typeVariable

TypeVariable typeVariable(ITypeBinding binding)
Determines the variable for a given type binding.

Parameters:
binding - Type binding.
Returns:
Variable for the given type binding.

thisVariable

ThisVariable thisVariable()
Returns the this variable, if the surrounding method is an instance method.

Returns:
The this variable, if the surrounding method is an instance method, null otherwise.

implicitThisVariable

ThisVariable implicitThisVariable(IBinding accessedElement)
Determines the implicit this variable for a method call or field access.

Parameters:
accessedElement - The element being accessed with an implicit this. Must be a IMethodBinding for a method or constructor or a IVariableBinding for a field.
Returns:
Implicit this variable for a method call or field access.
Throws:
IllegalArgumentException - is given binding is not a constructor, method or field.

superVariable

SuperVariable superVariable(Name qualifier)
Determines the super variable, taking a possible qualifier into account.

Parameters:
qualifier - Qualifier for super access; null for unqualified super.
Returns:
super variable for the given qualifier.