dk.brics.string.java
Interface TranslationContext

All Superinterfaces:
StaticStringTypes
All Known Implementing Classes:
Jimple2Intermediate

public interface TranslationContext
extends StaticStringTypes

Provides information from the higher-level aspects of the analysis to lower-level aspects. The methods in this interface are also present in IntermediateFactory.

Currently implemented by Jimple2Intermediate and used by StatementTranslatorImpl and its method call translators (see the translation overview), through the IntermediateFactory.


Method Summary
 VariableType fromSootType(Type type)
          Returns the most specific intermediate variable type that may be assigned to from the specified Java type.
 Application getApplication()
           
 Variable getExpressionVariable(Value value)
          Returns the variable holding the result of the specified expression.
 Method getMethod(SootMethod method)
          Returns the intermediate method definition corresponding to the specified Soot method, or null if the method is external.
 Variable getParameter(SootMethod method, ParameterRef ref)
          Returns the variable corresponding to a soot parameter reference
 List<SootMethod> getTargetsOf(InstanceInvokeExpr expr)
          Gets a list of possible targets for the specified invocation.
 Method getToStringMethod(SootClass c)
          Returns the intermediate method representing the specified non-interface class's toString method.
 VariableManager getVariableManager()
           
 boolean isHotspot(ValueBox expr)
          Returns true if the specified value is marked as a hotspot.
 boolean isSubtypeOf(SootClass a, SootClass b)
          Returns true if the first argument is a type that extends, implements, or equals the second argument.
 void setExpressionVariable(Value value, Variable variable)
          Reports that the specified expression was evaluated and stored in the specified intermediate variable.
 
Methods inherited from interface dk.brics.string.java.StaticStringTypes
getFieldType, getMethodReturnType, getParameterType
 

Method Detail

fromSootType

VariableType fromSootType(Type type)
Returns the most specific intermediate variable type that may be assigned to from the specified Java type.


getApplication

Application getApplication()

getExpressionVariable

Variable getExpressionVariable(Value value)
Returns the variable holding the result of the specified expression.

Parameters:
value - a jimple expression
Returns:
an intermediate variable, or null if the expression has not been translated

getMethod

Method getMethod(SootMethod method)
Returns the intermediate method definition corresponding to the specified Soot method, or null if the method is external.


getParameter

Variable getParameter(SootMethod method,
                      ParameterRef ref)
Returns the variable corresponding to a soot parameter reference


getTargetsOf

List<SootMethod> getTargetsOf(InstanceInvokeExpr expr)
Gets a list of possible targets for the specified invocation.


getToStringMethod

Method getToStringMethod(SootClass c)
Returns the intermediate method representing the specified non-interface class's toString method.

Parameters:
c - an application class that is not an interface.
Returns:
an intermediate method.

getVariableManager

VariableManager getVariableManager()

isHotspot

boolean isHotspot(ValueBox expr)
Returns true if the specified value is marked as a hotspot.


isSubtypeOf

boolean isSubtypeOf(SootClass a,
                    SootClass b)
Returns true if the first argument is a type that extends, implements, or equals the second argument.


setExpressionVariable

void setExpressionVariable(Value value,
                           Variable variable)
Reports that the specified expression was evaluated and stored in the specified intermediate variable.

Parameters:
value - a jimple expression
variable - an intermediate variable


Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.