soot.grimp
Class Grimp

java.lang.Object
  extended by soot.grimp.Grimp

public class Grimp
extends Object

The Grimp class contains all the constructors for the components of the Grimp grammar for the Grimp body.

Immediate -> Local | Constant
RValue -> Local | Constant | ConcreteRef | Expr
Variable -> Local | ArrayRef | InstanceFieldRef | StaticFieldRef


Constructor Summary
Grimp(Singletons.Global g)
           
 
Method Summary
static Value cloneIfNecessary(Value val)
           
 AddExpr newAddExpr(Value op1, Value op2)
          Constructs a AddExpr(Expr, Expr) grammar chunk.
 AndExpr newAndExpr(Value op1, Value op2)
          Constructs a AndExpr(Expr, Expr) grammar chunk.
 ValueBox newArgBox(Value value)
           
 ArrayRef newArrayRef(Value base, Value index)
          Constructs a ArrayRef(Local, Expr) grammar chunk.
 AssignStmt newAssignStmt(AssignStmt s)
           
 AssignStmt newAssignStmt(Value variable, Value rvalue)
          Constructs a AssignStmt(Variable, RValue) grammar chunk.
 GrimpBody newBody(Body b, String phase)
          Returns a GrimpBody constructed from b.
 GrimpBody newBody(SootMethod m)
          Returns an empty GrimpBody associated with method m.
 BreakpointStmt newBreakpointStmt()
          Constructs a BreakpointStmt() grammar chunk.
 BreakpointStmt newBreakpointStmt(BreakpointStmt s)
           
 CastExpr newCastExpr(Value op1, Type t)
          Constructs a CastExpr(Expr, Type) grammar chunk.
 CaughtExceptionRef newCaughtExceptionRef()
          Constructs a CaughtExceptionRef() grammar chunk.
 CmpExpr newCmpExpr(Value op1, Value op2)
          Constructs a CmpExpr(Expr, Expr) grammar chunk.
 CmpgExpr newCmpgExpr(Value op1, Value op2)
          Constructs a CmpgExpr(Expr, Expr) grammar chunk.
 CmplExpr newCmplExpr(Value op1, Value op2)
          Constructs a CmplExpr(Expr, Expr) grammar chunk.
 ValueBox newConditionExprBox(Value value)
           
 DivExpr newDivExpr(Value op1, Value op2)
          Constructs a DivExpr(Expr, Expr) grammar chunk.
 DynamicInvokeExpr newDynamicInvokeExpr(SootMethodRef bootstrapMethodRef, List<Value> bootstrapArgs, SootMethodRef methodRef, List args)
          Constructs a new DynamicInvokeExpr grammar chunk.
 EnterMonitorStmt newEnterMonitorStmt(EnterMonitorStmt s)
           
 EnterMonitorStmt newEnterMonitorStmt(Value op)
          Constructs a EnterMonitorStmt(Expr) grammar chunk.
 EqExpr newEqExpr(Value op1, Value op2)
          Constructs a EqExpr(Expr, Expr) grammar chunk.
 ExitMonitorStmt newExitMonitorStmt(ExitMonitorStmt s)
           
 ExitMonitorStmt newExitMonitorStmt(Value op)
          Constructs a ExitMonitorStmt(Expr) grammar chunk
 Value newExpr(Value value)
          Carries out the mapping from other Value's to Grimp Value's
 ValueBox newExprBox(Value value)
           
 GeExpr newGeExpr(Value op1, Value op2)
          Constructs a GeExpr(Expr, Expr) grammar chunk.
 GotoStmt newGotoStmt(GotoStmt s)
           
 GotoStmt newGotoStmt(Unit target)
          Constructs a GotoStmt(Stmt) grammar chunk.
 GtExpr newGtExpr(Value op1, Value op2)
          Constructs a GtExpr(Expr, Expr) grammar chunk.
 ValueBox newIdentityRefBox(Value value)
           
 IdentityStmt newIdentityStmt(IdentityStmt s)
           
 IdentityStmt newIdentityStmt(Value local, Value identityRef)
          Constructs a IdentityStmt(Local, IdentityRef) grammar chunk.
 IfStmt newIfStmt(IfStmt s)
           
 IfStmt newIfStmt(Value condition, Unit target)
          Constructs a IfStmt(Condition, Stmt) grammar chunk.
 ValueBox newImmediateBox(Value value)
           
 InstanceFieldRef newInstanceFieldRef(Value base, SootFieldRef f)
          Constructs a InstanceFieldRef(Value, SootFieldRef) grammar chunk.
 InstanceOfExpr newInstanceOfExpr(Value op1, Type t)
          Constructs a InstanceOfExpr(Expr, Type) grammar chunk.
 InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethodRef method, List args)
          Constructs a InterfaceInvokeExpr(Local base, SootMethodRef method, List of Expr) grammar chunk.
 ValueBox newInvokeExprBox(Value value)
           
 InvokeStmt newInvokeStmt(InvokeStmt s)
           
 InvokeStmt newInvokeStmt(Value op)
          Constructs a InvokeStmt(InvokeExpr) grammar chunk.
 LeExpr newLeExpr(Value op1, Value op2)
          Constructs a LeExpr(Expr, Expr) grammar chunk.
 LengthExpr newLengthExpr(Value op)
          Constructs a LengthExpr(Expr) grammar chunk.
 Local newLocal(String name, Type t)
          Constructs a Local with the given name and type.
 ValueBox newLocalBox(Value value)
           
 LookupSwitchStmt newLookupSwitchStmt(LookupSwitchStmt s)
           
 LookupSwitchStmt newLookupSwitchStmt(Value key, List lookupValues, List targets, Unit defaultTarget)
          Constructs a LookupSwitchStmt(Expr, List of Expr, List of Unit, Stmt) grammar chunk.
 LtExpr newLtExpr(Value op1, Value op2)
          Constructs a LtExpr(Expr, Expr) grammar chunk.
 MulExpr newMulExpr(Value op1, Value op2)
          Constructs a MulExpr(Expr, Expr) grammar chunk.
 NeExpr newNeExpr(Value op1, Value op2)
          Constructs a NeExpr(Expr, Expr) grammar chunk.
 NegExpr newNegExpr(Value op)
          Constructs a NegExpr(Expr, Expr) grammar chunk.
 NewArrayExpr newNewArrayExpr(Type type, Value size)
          Constructs a NewArrayExpr(Type, Expr) grammar chunk.
 NewInvokeExpr newNewInvokeExpr(RefType base, SootMethodRef method, List args)
          Constructs a NewInvokeExpr(Local base, List of Expr) grammar chunk.
 NewMultiArrayExpr newNewMultiArrayExpr(ArrayType type, List sizes)
          Constructs a NewMultiArrayExpr(ArrayType, List of Expr) grammar chunk.
 NopStmt newNopStmt()
          Constructs a NopStmt() grammar chunk.
 NopStmt newNopStmt(NopStmt s)
           
 ValueBox newObjExprBox(Value value)
           
 OrExpr newOrExpr(Value op1, Value op2)
          Constructs a OrExpr(Expr, Expr) grammar chunk.
 ParameterRef newParameterRef(Type paramType, int number)
          Constructs a ParameterRef(SootMethod, int) grammar chunk.
 RemExpr newRemExpr(Value op1, Value op2)
          Constructs a RemExpr(Expr, Expr) grammar chunk.
 ReturnStmt newReturnStmt(ReturnStmt s)
           
 ReturnStmt newReturnStmt(Value op)
          Constructs a ReturnStmt(Expr) grammar chunk.
 ReturnVoidStmt newReturnVoidStmt()
          Constructs a ReturnVoidStmt() grammar chunk.
 ReturnVoidStmt newReturnVoidStmt(ReturnVoidStmt s)
           
 ValueBox newRValueBox(Value value)
           
 ShlExpr newShlExpr(Value op1, Value op2)
          Constructs a ShlExpr(Expr, Expr) grammar chunk.
 ShrExpr newShrExpr(Value op1, Value op2)
          Constructs a ShrExpr(Expr, Expr) grammar chunk.
 SpecialInvokeExpr newSpecialInvokeExpr(Local base, SootMethodRef method, List args)
          Constructs a SpecialInvokeExpr(Local base, SootMethodRef method, List of Expr) grammar chunk.
 StaticFieldRef newStaticFieldRef(SootFieldRef f)
          Constructs a StaticFieldRef(SootFieldRef) grammar chunk.
 StaticInvokeExpr newStaticInvokeExpr(SootMethodRef method, List args)
          Constructs a StaticInvokeExpr(ArrayType, List of Expr) grammar chunk.
 UnitBox newStmtBox(Unit unit)
           
 SubExpr newSubExpr(Value op1, Value op2)
          Constructs a SubExpr(Expr, Expr) grammar chunk.
 TableSwitchStmt newTableSwitchStmt(TableSwitchStmt s)
           
 TableSwitchStmt newTableSwitchStmt(Value key, int lowIndex, int highIndex, List targets, Unit defaultTarget)
          Constructs a TableSwitchStmt(Expr, int, int, List of Unit, Stmt) grammar chunk.
 ThisRef newThisRef(RefType t)
          Constructs a ThisRef(RefType) grammar chunk.
 ThrowStmt newThrowStmt(ThrowStmt s)
           
 ThrowStmt newThrowStmt(Value op)
          Constructs a ThrowStmt(Expr) grammar chunk.
 Trap newTrap(SootClass exception, Unit beginStmt, Unit endStmt, Unit handlerStmt)
          Constructs a new Trap for the given exception on the given Stmt range with the given Stmt handler.
 Trap newTrap(Trap trap)
           
 UshrExpr newUshrExpr(Value op1, Value op2)
          Constructs a UshrExpr(Expr, Expr) grammar chunk.
 ValueBox newVariableBox(Value value)
           
 VirtualInvokeExpr newVirtualInvokeExpr(Local base, SootMethodRef method, List args)
          Constructs a VirtualInvokeExpr(Local base, SootMethodRef method, List of Expr) grammar chunk.
 XorExpr newXorExpr(Value op1, Value op2)
          Constructs a XorExpr(Expr, Expr) grammar chunk.
static Grimp v()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grimp

public Grimp(Singletons.Global g)
Method Detail

v

public static Grimp v()

newXorExpr

public XorExpr newXorExpr(Value op1,
                          Value op2)
Constructs a XorExpr(Expr, Expr) grammar chunk.


newUshrExpr

public UshrExpr newUshrExpr(Value op1,
                            Value op2)
Constructs a UshrExpr(Expr, Expr) grammar chunk.


newSubExpr

public SubExpr newSubExpr(Value op1,
                          Value op2)
Constructs a SubExpr(Expr, Expr) grammar chunk.


newShrExpr

public ShrExpr newShrExpr(Value op1,
                          Value op2)
Constructs a ShrExpr(Expr, Expr) grammar chunk.


newShlExpr

public ShlExpr newShlExpr(Value op1,
                          Value op2)
Constructs a ShlExpr(Expr, Expr) grammar chunk.


newRemExpr

public RemExpr newRemExpr(Value op1,
                          Value op2)
Constructs a RemExpr(Expr, Expr) grammar chunk.


newOrExpr

public OrExpr newOrExpr(Value op1,
                        Value op2)
Constructs a OrExpr(Expr, Expr) grammar chunk.


newNeExpr

public NeExpr newNeExpr(Value op1,
                        Value op2)
Constructs a NeExpr(Expr, Expr) grammar chunk.


newMulExpr

public MulExpr newMulExpr(Value op1,
                          Value op2)
Constructs a MulExpr(Expr, Expr) grammar chunk.


newLeExpr

public LeExpr newLeExpr(Value op1,
                        Value op2)
Constructs a LeExpr(Expr, Expr) grammar chunk.


newGeExpr

public GeExpr newGeExpr(Value op1,
                        Value op2)
Constructs a GeExpr(Expr, Expr) grammar chunk.


newEqExpr

public EqExpr newEqExpr(Value op1,
                        Value op2)
Constructs a EqExpr(Expr, Expr) grammar chunk.


newDivExpr

public DivExpr newDivExpr(Value op1,
                          Value op2)
Constructs a DivExpr(Expr, Expr) grammar chunk.


newCmplExpr

public CmplExpr newCmplExpr(Value op1,
                            Value op2)
Constructs a CmplExpr(Expr, Expr) grammar chunk.


newCmpgExpr

public CmpgExpr newCmpgExpr(Value op1,
                            Value op2)
Constructs a CmpgExpr(Expr, Expr) grammar chunk.


newCmpExpr

public CmpExpr newCmpExpr(Value op1,
                          Value op2)
Constructs a CmpExpr(Expr, Expr) grammar chunk.


newGtExpr

public GtExpr newGtExpr(Value op1,
                        Value op2)
Constructs a GtExpr(Expr, Expr) grammar chunk.


newLtExpr

public LtExpr newLtExpr(Value op1,
                        Value op2)
Constructs a LtExpr(Expr, Expr) grammar chunk.


newAddExpr

public AddExpr newAddExpr(Value op1,
                          Value op2)
Constructs a AddExpr(Expr, Expr) grammar chunk.


newAndExpr

public AndExpr newAndExpr(Value op1,
                          Value op2)
Constructs a AndExpr(Expr, Expr) grammar chunk.


newNegExpr

public NegExpr newNegExpr(Value op)
Constructs a NegExpr(Expr, Expr) grammar chunk.


newLengthExpr

public LengthExpr newLengthExpr(Value op)
Constructs a LengthExpr(Expr) grammar chunk.


newCastExpr

public CastExpr newCastExpr(Value op1,
                            Type t)
Constructs a CastExpr(Expr, Type) grammar chunk.


newInstanceOfExpr

public InstanceOfExpr newInstanceOfExpr(Value op1,
                                        Type t)
Constructs a InstanceOfExpr(Expr, Type) grammar chunk.


newNewArrayExpr

public NewArrayExpr newNewArrayExpr(Type type,
                                    Value size)
Constructs a NewArrayExpr(Type, Expr) grammar chunk.


newNewMultiArrayExpr

public NewMultiArrayExpr newNewMultiArrayExpr(ArrayType type,
                                              List sizes)
Constructs a NewMultiArrayExpr(ArrayType, List of Expr) grammar chunk.


newNewInvokeExpr

public NewInvokeExpr newNewInvokeExpr(RefType base,
                                      SootMethodRef method,
                                      List args)
Constructs a NewInvokeExpr(Local base, List of Expr) grammar chunk.


newStaticInvokeExpr

public StaticInvokeExpr newStaticInvokeExpr(SootMethodRef method,
                                            List args)
Constructs a StaticInvokeExpr(ArrayType, List of Expr) grammar chunk.


newSpecialInvokeExpr

public SpecialInvokeExpr newSpecialInvokeExpr(Local base,
                                              SootMethodRef method,
                                              List args)
Constructs a SpecialInvokeExpr(Local base, SootMethodRef method, List of Expr) grammar chunk.


newVirtualInvokeExpr

public VirtualInvokeExpr newVirtualInvokeExpr(Local base,
                                              SootMethodRef method,
                                              List args)
Constructs a VirtualInvokeExpr(Local base, SootMethodRef method, List of Expr) grammar chunk.


newDynamicInvokeExpr

public DynamicInvokeExpr newDynamicInvokeExpr(SootMethodRef bootstrapMethodRef,
                                              List<Value> bootstrapArgs,
                                              SootMethodRef methodRef,
                                              List args)
Constructs a new DynamicInvokeExpr grammar chunk.


newInterfaceInvokeExpr

public InterfaceInvokeExpr newInterfaceInvokeExpr(Local base,
                                                  SootMethodRef method,
                                                  List args)
Constructs a InterfaceInvokeExpr(Local base, SootMethodRef method, List of Expr) grammar chunk.


newThrowStmt

public ThrowStmt newThrowStmt(Value op)
Constructs a ThrowStmt(Expr) grammar chunk.


newThrowStmt

public ThrowStmt newThrowStmt(ThrowStmt s)

newExitMonitorStmt

public ExitMonitorStmt newExitMonitorStmt(Value op)
Constructs a ExitMonitorStmt(Expr) grammar chunk


newExitMonitorStmt

public ExitMonitorStmt newExitMonitorStmt(ExitMonitorStmt s)

newEnterMonitorStmt

public EnterMonitorStmt newEnterMonitorStmt(Value op)
Constructs a EnterMonitorStmt(Expr) grammar chunk.


newEnterMonitorStmt

public EnterMonitorStmt newEnterMonitorStmt(EnterMonitorStmt s)

newBreakpointStmt

public BreakpointStmt newBreakpointStmt()
Constructs a BreakpointStmt() grammar chunk.


newBreakpointStmt

public BreakpointStmt newBreakpointStmt(BreakpointStmt s)

newGotoStmt

public GotoStmt newGotoStmt(Unit target)
Constructs a GotoStmt(Stmt) grammar chunk.


newGotoStmt

public GotoStmt newGotoStmt(GotoStmt s)

newNopStmt

public NopStmt newNopStmt()
Constructs a NopStmt() grammar chunk.


newNopStmt

public NopStmt newNopStmt(NopStmt s)

newReturnVoidStmt

public ReturnVoidStmt newReturnVoidStmt()
Constructs a ReturnVoidStmt() grammar chunk.


newReturnVoidStmt

public ReturnVoidStmt newReturnVoidStmt(ReturnVoidStmt s)

newReturnStmt

public ReturnStmt newReturnStmt(Value op)
Constructs a ReturnStmt(Expr) grammar chunk.


newReturnStmt

public ReturnStmt newReturnStmt(ReturnStmt s)

newIfStmt

public IfStmt newIfStmt(Value condition,
                        Unit target)
Constructs a IfStmt(Condition, Stmt) grammar chunk.


newIfStmt

public IfStmt newIfStmt(IfStmt s)

newIdentityStmt

public IdentityStmt newIdentityStmt(Value local,
                                    Value identityRef)
Constructs a IdentityStmt(Local, IdentityRef) grammar chunk.


newIdentityStmt

public IdentityStmt newIdentityStmt(IdentityStmt s)

newAssignStmt

public AssignStmt newAssignStmt(Value variable,
                                Value rvalue)
Constructs a AssignStmt(Variable, RValue) grammar chunk.


newAssignStmt

public AssignStmt newAssignStmt(AssignStmt s)

newInvokeStmt

public InvokeStmt newInvokeStmt(Value op)
Constructs a InvokeStmt(InvokeExpr) grammar chunk.


newInvokeStmt

public InvokeStmt newInvokeStmt(InvokeStmt s)

newTableSwitchStmt

public TableSwitchStmt newTableSwitchStmt(Value key,
                                          int lowIndex,
                                          int highIndex,
                                          List targets,
                                          Unit defaultTarget)
Constructs a TableSwitchStmt(Expr, int, int, List of Unit, Stmt) grammar chunk.


newTableSwitchStmt

public TableSwitchStmt newTableSwitchStmt(TableSwitchStmt s)

newLookupSwitchStmt

public LookupSwitchStmt newLookupSwitchStmt(Value key,
                                            List lookupValues,
                                            List targets,
                                            Unit defaultTarget)
Constructs a LookupSwitchStmt(Expr, List of Expr, List of Unit, Stmt) grammar chunk.


newLookupSwitchStmt

public LookupSwitchStmt newLookupSwitchStmt(LookupSwitchStmt s)

newLocal

public Local newLocal(String name,
                      Type t)
Constructs a Local with the given name and type.


newTrap

public Trap newTrap(SootClass exception,
                    Unit beginStmt,
                    Unit endStmt,
                    Unit handlerStmt)
Constructs a new Trap for the given exception on the given Stmt range with the given Stmt handler.


newTrap

public Trap newTrap(Trap trap)

newStaticFieldRef

public StaticFieldRef newStaticFieldRef(SootFieldRef f)
Constructs a StaticFieldRef(SootFieldRef) grammar chunk.


newThisRef

public ThisRef newThisRef(RefType t)
Constructs a ThisRef(RefType) grammar chunk.


newParameterRef

public ParameterRef newParameterRef(Type paramType,
                                    int number)
Constructs a ParameterRef(SootMethod, int) grammar chunk.


newInstanceFieldRef

public InstanceFieldRef newInstanceFieldRef(Value base,
                                            SootFieldRef f)
Constructs a InstanceFieldRef(Value, SootFieldRef) grammar chunk.


newCaughtExceptionRef

public CaughtExceptionRef newCaughtExceptionRef()
Constructs a CaughtExceptionRef() grammar chunk.


newArrayRef

public ArrayRef newArrayRef(Value base,
                            Value index)
Constructs a ArrayRef(Local, Expr) grammar chunk.


newVariableBox

public ValueBox newVariableBox(Value value)

newLocalBox

public ValueBox newLocalBox(Value value)

newRValueBox

public ValueBox newRValueBox(Value value)

newImmediateBox

public ValueBox newImmediateBox(Value value)

newExprBox

public ValueBox newExprBox(Value value)

newArgBox

public ValueBox newArgBox(Value value)

newObjExprBox

public ValueBox newObjExprBox(Value value)

newIdentityRefBox

public ValueBox newIdentityRefBox(Value value)

newConditionExprBox

public ValueBox newConditionExprBox(Value value)

newInvokeExprBox

public ValueBox newInvokeExprBox(Value value)

newStmtBox

public UnitBox newStmtBox(Unit unit)

newExpr

public Value newExpr(Value value)
Carries out the mapping from other Value's to Grimp Value's


newBody

public GrimpBody newBody(SootMethod m)
Returns an empty GrimpBody associated with method m.


newBody

public GrimpBody newBody(Body b,
                         String phase)
Returns a GrimpBody constructed from b.


cloneIfNecessary

public static Value cloneIfNecessary(Value val)