Package org.eolang.opeo.decompilation
Class OperandStack
java.lang.Object
org.eolang.opeo.decompilation.OperandStack
Operand stack.
You can read more about it here
It emulates the behaviour of JVM operand stack.- Since:
- 0.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dup()
Duplicate the higher value on the stack.first()
Pop one node from the stack or return empty.pop()
Pop one node from the stack.pop
(int number) Pop N nodes from the stack.pretty()
Pretty representation of the stack.void
Push one more node to the stack.
-
Constructor Details
-
OperandStack
public OperandStack()Default constructor. -
OperandStack
Constructor.- Parameters:
nodes
- Initial stack nodes.
-
-
Method Details
-
first
Pop one node from the stack or return empty.- Returns:
- Optional node.
-
pop
Pop one node from the stack.- Returns:
- Node.
-
pop
Pop N nodes from the stack.- Parameters:
number
- Number of nodes to pop.- Returns:
- Collection of nodes.
-
push
Push one more node to the stack.- Parameters:
node
- Node to add to the stack.
-
dup
public void dup()Duplicate the higher value on the stack. -
pretty
Pretty representation of the stack.- Returns:
- Human-readable string that represents the stack state.
-