dk.brics.string.java
Class StatementTranslatorImpl
java.lang.Object
dk.brics.string.java.ExprAnswerVisitor<ValueBox,Variable>
dk.brics.string.java.StatementTranslatorImpl
- All Implemented Interfaces:
- StatementTranslator, StmtSwitch, Switch
public class StatementTranslatorImpl
- extends ExprAnswerVisitor<ValueBox,Variable>
- implements StmtSwitch, StatementTranslator
Translates Jimple-expressions and -statements into Statement
s in intermediate form.
This interface requires an implementation of the IntermediateFactory
facade,
which is currently provided by the StatementTranslatorFacadeImpl
.
Note that this class is also responsible for creating Hotspot
statements for each
ValueBox marked as a hotspot. IntermediateFactory.isHotspot(soot.ValueBox)
defines what
is a hotspot.
Method Summary |
void |
assignment(DefinitionStmt stmt)
|
Variable |
caseArrayRef(ArrayRef v,
ValueBox box)
|
void |
caseAssignStmt(AssignStmt stmt)
|
void |
caseBreakpointStmt(BreakpointStmt stmt)
|
Variable |
caseCastExpr(CastExpr v,
ValueBox box)
|
void |
caseEnterMonitorStmt(EnterMonitorStmt stmt)
|
Variable |
caseEqExpr(EqExpr v,
ValueBox question)
|
void |
caseExitMonitorStmt(ExitMonitorStmt stmt)
|
void |
caseGotoStmt(GotoStmt stmt)
|
void |
caseIdentityStmt(IdentityStmt stmt)
|
void |
caseIfStmt(IfStmt stmt)
|
Variable |
caseInstanceFieldRef(InstanceFieldRef v,
ValueBox box)
|
Variable |
caseIntConstant(IntConstant v,
ValueBox question)
|
Variable |
caseInterfaceInvokeExpr(InterfaceInvokeExpr v,
ValueBox box)
|
void |
caseInvokeStmt(InvokeStmt stmt)
|
Variable |
caseLocal(Local v,
ValueBox box)
|
void |
caseLookupSwitchStmt(LookupSwitchStmt stmt)
|
Variable |
caseNeExpr(NeExpr v,
ValueBox question)
|
Variable |
caseNewArrayExpr(NewArrayExpr v,
ValueBox box)
|
Variable |
caseNewExpr(NewExpr v,
ValueBox box)
|
Variable |
caseNewMultiArrayExpr(NewMultiArrayExpr v,
ValueBox box)
|
void |
caseNopStmt(NopStmt stmt)
|
Variable |
caseNullConstant(NullConstant v,
ValueBox box)
|
Variable |
caseParameterRef(ParameterRef v,
ValueBox box)
|
void |
caseRetStmt(RetStmt stmt)
|
void |
caseReturnStmt(ReturnStmt stmt)
|
void |
caseReturnVoidStmt(ReturnVoidStmt stmt)
|
Variable |
caseSpecialInvokeExpr(SpecialInvokeExpr v,
ValueBox box)
|
Variable |
caseStaticFieldRef(StaticFieldRef v,
ValueBox box)
|
Variable |
caseStaticInvokeExpr(StaticInvokeExpr v,
ValueBox box)
|
Variable |
caseStringConstant(StringConstant v,
ValueBox box)
|
void |
caseTableSwitchStmt(TableSwitchStmt stmt)
|
void |
caseThrowStmt(ThrowStmt stmt)
|
Variable |
caseVirtualInvokeExpr(VirtualInvokeExpr v,
ValueBox box)
|
void |
defaultCase(Object obj)
|
Variable |
defaultExpr(Object v,
ValueBox box)
|
void |
translateStatement(Stmt statement,
IntermediateFactory factory)
Translates the specified statement into intermediate code, using
the specified factory. |
Methods inherited from class dk.brics.string.java.ExprAnswerVisitor |
applyTo, caseAddExpr, caseAndExpr, caseCaughtExceptionRef, caseClassConstant, caseCmpExpr, caseCmpgExpr, caseCmplExpr, caseDivExpr, caseDoubleConstant, caseFloatConstant, caseGeExpr, caseGtExpr, caseInstanceOfExpr, caseLeExpr, caseLengthExpr, caseLongConstant, caseLtExpr, caseMulExpr, caseNegExpr, caseOrExpr, caseRemExpr, caseShlExpr, caseShrExpr, caseSubExpr, caseThisRef, caseUshrExpr, caseXorExpr |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StatementTranslatorImpl
public StatementTranslatorImpl(MethodCallTranslator methodCalls,
FieldReferenceTranslator fields)
assignment
public void assignment(DefinitionStmt stmt)
caseArrayRef
public Variable caseArrayRef(ArrayRef v,
ValueBox box)
- Overrides:
caseArrayRef
in class ExprAnswerVisitor<ValueBox,Variable>
caseAssignStmt
public void caseAssignStmt(AssignStmt stmt)
- Specified by:
caseAssignStmt
in interface StmtSwitch
caseBreakpointStmt
public void caseBreakpointStmt(BreakpointStmt stmt)
- Specified by:
caseBreakpointStmt
in interface StmtSwitch
caseCastExpr
public Variable caseCastExpr(CastExpr v,
ValueBox box)
- Overrides:
caseCastExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseEnterMonitorStmt
public void caseEnterMonitorStmt(EnterMonitorStmt stmt)
- Specified by:
caseEnterMonitorStmt
in interface StmtSwitch
caseEqExpr
public Variable caseEqExpr(EqExpr v,
ValueBox question)
- Overrides:
caseEqExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseExitMonitorStmt
public void caseExitMonitorStmt(ExitMonitorStmt stmt)
- Specified by:
caseExitMonitorStmt
in interface StmtSwitch
caseGotoStmt
public void caseGotoStmt(GotoStmt stmt)
- Specified by:
caseGotoStmt
in interface StmtSwitch
caseIdentityStmt
public void caseIdentityStmt(IdentityStmt stmt)
- Specified by:
caseIdentityStmt
in interface StmtSwitch
caseIfStmt
public void caseIfStmt(IfStmt stmt)
- Specified by:
caseIfStmt
in interface StmtSwitch
caseInstanceFieldRef
public Variable caseInstanceFieldRef(InstanceFieldRef v,
ValueBox box)
- Overrides:
caseInstanceFieldRef
in class ExprAnswerVisitor<ValueBox,Variable>
caseIntConstant
public Variable caseIntConstant(IntConstant v,
ValueBox question)
- Overrides:
caseIntConstant
in class ExprAnswerVisitor<ValueBox,Variable>
caseInterfaceInvokeExpr
public Variable caseInterfaceInvokeExpr(InterfaceInvokeExpr v,
ValueBox box)
- Overrides:
caseInterfaceInvokeExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseInvokeStmt
public void caseInvokeStmt(InvokeStmt stmt)
- Specified by:
caseInvokeStmt
in interface StmtSwitch
caseLocal
public Variable caseLocal(Local v,
ValueBox box)
- Overrides:
caseLocal
in class ExprAnswerVisitor<ValueBox,Variable>
caseLookupSwitchStmt
public void caseLookupSwitchStmt(LookupSwitchStmt stmt)
- Specified by:
caseLookupSwitchStmt
in interface StmtSwitch
caseNeExpr
public Variable caseNeExpr(NeExpr v,
ValueBox question)
- Overrides:
caseNeExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseNewArrayExpr
public Variable caseNewArrayExpr(NewArrayExpr v,
ValueBox box)
- Overrides:
caseNewArrayExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseNewExpr
public Variable caseNewExpr(NewExpr v,
ValueBox box)
- Overrides:
caseNewExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseNewMultiArrayExpr
public Variable caseNewMultiArrayExpr(NewMultiArrayExpr v,
ValueBox box)
- Overrides:
caseNewMultiArrayExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseNopStmt
public void caseNopStmt(NopStmt stmt)
- Specified by:
caseNopStmt
in interface StmtSwitch
caseNullConstant
public Variable caseNullConstant(NullConstant v,
ValueBox box)
- Overrides:
caseNullConstant
in class ExprAnswerVisitor<ValueBox,Variable>
caseParameterRef
public Variable caseParameterRef(ParameterRef v,
ValueBox box)
- Overrides:
caseParameterRef
in class ExprAnswerVisitor<ValueBox,Variable>
caseRetStmt
public void caseRetStmt(RetStmt stmt)
- Specified by:
caseRetStmt
in interface StmtSwitch
caseReturnStmt
public void caseReturnStmt(ReturnStmt stmt)
- Specified by:
caseReturnStmt
in interface StmtSwitch
caseReturnVoidStmt
public void caseReturnVoidStmt(ReturnVoidStmt stmt)
- Specified by:
caseReturnVoidStmt
in interface StmtSwitch
caseSpecialInvokeExpr
public Variable caseSpecialInvokeExpr(SpecialInvokeExpr v,
ValueBox box)
- Overrides:
caseSpecialInvokeExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseStaticFieldRef
public Variable caseStaticFieldRef(StaticFieldRef v,
ValueBox box)
- Overrides:
caseStaticFieldRef
in class ExprAnswerVisitor<ValueBox,Variable>
caseStaticInvokeExpr
public Variable caseStaticInvokeExpr(StaticInvokeExpr v,
ValueBox box)
- Overrides:
caseStaticInvokeExpr
in class ExprAnswerVisitor<ValueBox,Variable>
caseStringConstant
public Variable caseStringConstant(StringConstant v,
ValueBox box)
- Overrides:
caseStringConstant
in class ExprAnswerVisitor<ValueBox,Variable>
caseTableSwitchStmt
public void caseTableSwitchStmt(TableSwitchStmt stmt)
- Specified by:
caseTableSwitchStmt
in interface StmtSwitch
caseThrowStmt
public void caseThrowStmt(ThrowStmt stmt)
- Specified by:
caseThrowStmt
in interface StmtSwitch
caseVirtualInvokeExpr
public Variable caseVirtualInvokeExpr(VirtualInvokeExpr v,
ValueBox box)
- Overrides:
caseVirtualInvokeExpr
in class ExprAnswerVisitor<ValueBox,Variable>
defaultCase
public void defaultCase(Object obj)
- Specified by:
defaultCase
in interface StmtSwitch
defaultExpr
public Variable defaultExpr(Object v,
ValueBox box)
- Overrides:
defaultExpr
in class ExprAnswerVisitor<ValueBox,Variable>
translateStatement
public void translateStatement(Stmt statement,
IntermediateFactory factory)
- Description copied from interface:
StatementTranslator
- Translates the specified statement into intermediate code, using
the specified factory. The results of the translation exist only in
the side-effects imposed by method calls to the factory.
- Specified by:
translateStatement
in interface StatementTranslator
- Parameters:
statement
- the jimple statement to translate.factory
- the factory to produce intermediate code with.
Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.