de.rwth.dfa.jvm.samples
Class CPAbstraction.DupFunction
java.lang.Object
|
+--de.rwth.dfa.jvm.samples.CPAbstraction.CPFunction
|
+--de.rwth.dfa.jvm.samples.CPAbstraction.DupFunction
- All Implemented Interfaces:
- Function
- Enclosing class:
- CPAbstraction
- protected class CPAbstraction.DupFunction
- extends CPAbstraction.CPFunction
Duplicates n elements on the stack under x other elements.
Field Summary |
protected int |
n
The number of elements on top to duplicate. |
protected int |
x
The number of elements under the n original elements. |
Method Summary |
protected void |
apply(java.lang.Object[] locals,
java.util.Stack stack)
Removes the n top elements from the stack, then removes x elements from the
remaining stack, pushes the n elements, pushed the x elements, and pushes the
n elements again. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
n
protected int n
- The number of elements on top to duplicate.
x
protected int x
- The number of elements under the n original elements.
CPAbstraction.DupFunction
public CPAbstraction.DupFunction(int x,
int n,
int consume,
int produce)
- Creates a new
DupFunction
instance.
- Parameters:
x
- an int
valuen
- an int
valueconsume
- an int
valueproduce
- an int
value
apply
protected void apply(java.lang.Object[] locals,
java.util.Stack stack)
throws FunctionException
- Removes the n top elements from the stack, then removes x elements from the
remaining stack, pushes the n elements, pushed the x elements, and pushes the
n elements again.
- Overrides:
apply
in class CPAbstraction.CPFunction
- Parameters:
locals
- an Object[]
valuestack
- a Stack
value- Throws:
FunctionException
- if an error occurs
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object