Removes all elements from the stack.
Inserts the given value into the stack down
elements below the current
top element.
Inserts the given value into the stack down
elements below the current
top element. insert(0, 'x')
is therefore equal to push('x')
.
Throws a ValueStackOverflowException
if the stack has no more space available.
Throws a ValueStackUnderflowException
if down > size
.
Throws an IllegalArgumentException
is down
is negative.
True if no elements are currently on the stack.
True if no elements are currently on the stack.
Returns an iterator that iterates over a *snapshot* of the stack elements at the time of this method call.
Returns an iterator that iterates over a *snapshot* of the stack elements at the time of this method call. I.e. subsequent mutations are not visible to the iterator.
Returns the element down
elements below the current top element without removing it.
Returns the element down
elements below the current top element without removing it.
peek(0)
is therefore equal to peek()
.
Throws a ValueStackUnderflowException
if down >= size
.
Throws an IllegalArgumentException
is down
is negative.
Returns the top element without removing it.
Returns the top element without removing it.
Throws a ValueStackUnderflowException
if the stack is empty.
Replaces the element down
elements below the current top element with the given one.
Replaces the element down
elements below the current top element with the given one.
Throws a ValueStackUnderflowException
if down >= size
.
Throws an IllegalArgumentException
if down
is negative.
Removes the top element from the stack and returns it.
Removes the top element from the stack and returns it.
Throws a ValueStackUnderflowException
if the stack is empty.
Removes the element down
elements below the current top element from the stack
and returns it.
Removes the element down
elements below the current top element from the stack
and returns it. pullOut(0)
is therefore equal to pop()
.
Throws a ValueStackUnderflowException
if down >= size
.
Throws an IllegalArgumentException
is down
is negative.
Puts the given value onto the stack.
Puts the given value onto the stack.
Throws a ValueStackOverflowException
if the stack has no more space available.
Puts the given HList of values onto the stack.
Puts the given HList of values onto the stack.
Throws a ValueStackOverflowException
if the stack has no more space available.
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Creates a string representation of the current value stack contents.
Creates a string representation of the current value stack contents. Mostly useful for debugging.
The number of elements currently on the stack.
The number of elements currently on the stack.
Swaps the top 2 stack elements.
Swaps the top 2 stack elements.
Throws a ValueStackUnderflowException
if size < 2
.
Swaps the top 3 stack elements.
Swaps the top 3 stack elements.
Throws a ValueStackUnderflowException
if size < 3
.
Swaps the top 4 stack elements.
Swaps the top 4 stack elements.
Throws a ValueStackUnderflowException
if size < 4
.
Swaps the top 5 stack elements.
Swaps the top 5 stack elements.
Throws a ValueStackUnderflowException
if size < 5
.
Returns all current stack elements as a new array.
Copies all elements between the given start
(inclusive) and end
(exclusive)
indices into an HList that is prepended to the given tail.
Copies all elements between the given start
(inclusive) and end
(exclusive)
indices into an HList that is prepended to the given tail.
Throws an IllegalArgumentException
if start < 0 || start > end
.
Throws a ValueStackUnderflowException
if end > size
.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
(valueStack: MonadOps[Any]).filter(p)
(valueStack: MonadOps[Any]).flatMap(f)
(valueStack: FlattenOps[A]).flatten
(valueStack: MonadOps[Any]).map(f)
(valueStack: MonadOps[Any]).withFilter(p)
A mutable untyped stack of values. In most cases you won't have to access its API directly since parboiled2's DSL should allow you a safer and easier way to interact with the stack. However, in some cases, when you know what you are doing, direct access can be helpful.