|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IntermediateFactory
This is a Facade pattern, used by StatementTranslatorImpl
and MethodCallTranslator
.
It is designed to minimize the amount of code required in these classes.
addStatement(dk.brics.string.intermediate.Statement)
itself determines where to place a statement,
and canBeNull(soot.Local)
itself knows which statement is currently being translated.
It is likely that more methods will be added during development.
Method Summary | |
---|---|
void |
addHotspot(Variable var,
ValueBox box)
Registers the specified value box as a hotspot. |
void |
addStatement(Statement stm)
Adds a statement to the intermediate program. |
boolean |
canBeNull(Local local)
Returns whether the specified local might be null at the current program point. |
Variable |
createVariable(VariableType type)
Creates a new variable with the specified type. |
void |
endBranch()
Ends the current branch, by removing the position stored by the previous call to startBranch() ,
and restores the position marked by the startBranch before that. |
VariableType |
fromSootType(Type type)
|
Field |
getField(SootField field)
Returns the intermediate field corresponding to the specified field; |
Automaton |
getFieldType(SootField field)
Returns the static string type of the specified field, or null if the field has no static string type. |
Variable |
getLocal(Local local)
Returns the intermediate variable corresponding to the specified local. |
Method |
getMethod(SootMethod method)
Returns the intermediate method definition corresponding to the specified Soot method, or null if the method is external. |
Automaton |
getMethodReturnType(SootMethod method)
Returns the static string type of the specified method's return value, or null if the return value has no static string type. |
Variable |
getNothing()
Returns a variable representing everything we don't care about in the analysis. |
Variable |
getParameter(ParameterRef ref)
Returns the variable corresponding to a soot parameter reference |
Automaton |
getParameterType(ParameterRef ref)
Returns the static string type of the nth parameter to the specified method, or null if the parameter has no static string type. |
List<SootMethod> |
getTargetsOf(InstanceInvokeExpr invocation)
Gets a list of possible targets for the specified invocation. |
Method |
getToStringMethod(SootClass clazz)
Returns the intermediate method representing the specified non-interface class's toString method. |
boolean |
isHotspot(ValueBox box)
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(ValueBox value,
Variable variable)
Reports that the specified expression was evaluated and stored in the specified intermediate variable. |
void |
startBranch()
Remembers the current position in the program, so successive calls to useBranch() jumps back here. |
void |
useBranch()
Jumps back to the statement added before the previous call to startBranch() ,
so statements added with addStatement(Statement) are added from there. |
Method Detail |
---|
void addHotspot(Variable var, ValueBox box)
isHotspot(ValueBox)
returned true for
the specified value box.
var
- variable holding the result of the hotspto expressionbox
- value box containing the expression marked as a hotspotvoid addStatement(Statement stm)
stm
- statement to add.boolean canBeNull(Local local)
local
- a soot local variable
Variable createVariable(VariableType type)
type
- type of the variable to create.
void endBranch()
startBranch()
,
and restores the position marked by the startBranch before that.
VariableType fromSootType(Type type)
Field getField(SootField field)
Automaton getFieldType(SootField field)
field
- a field
Variable getLocal(Local local)
Method getMethod(SootMethod method)
Automaton getMethodReturnType(SootMethod method)
method
- a soot method
Variable getNothing()
Variable getParameter(ParameterRef ref)
Automaton getParameterType(ParameterRef ref)
ref
- a parameter
List<SootMethod> getTargetsOf(InstanceInvokeExpr invocation)
Method getToStringMethod(SootClass clazz)
clazz
- an application class that is not an interface.
boolean isHotspot(ValueBox box)
boolean isSubtypeOf(SootClass a, SootClass b)
void setExpressionVariable(ValueBox value, Variable variable)
value
- a jimple expressionvariable
- an intermediate variablevoid startBranch()
useBranch()
jumps back here.
void useBranch()
startBranch()
,
so statements added with addStatement(Statement)
are added from there.
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |