ValueStack

org.parboiled2.ValueStack
class ValueStack extends Iterable[Any]

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.

Attributes

Graph
Supertypes
trait Iterable[Any]
trait IterableFactoryDefaults[Any, Iterable]
trait IterableOps[Any, Iterable, Iterable[Any]]
trait IterableOnceOps[Any, Iterable, Iterable[Any]]
trait IterableOnce[Any]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def clear(): Unit

Removes all elements from the stack.

Removes all elements from the stack.

Attributes

def insert(down: Int, value: Any): Unit

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.

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.

Attributes

override def isEmpty: Boolean

True if no elements are currently on the stack.

True if no elements are currently on the stack.

Attributes

Definition Classes
IterableOnceOps
def iterator: Iterator[Any]

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 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.

Attributes

def peek: Any

Returns the top element without removing it. Throws a ValueStackUnderflowException if the stack is empty.

Returns the top element without removing it. Throws a ValueStackUnderflowException if the stack is empty.

Attributes

def peek(down: Int): Any

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 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.

Attributes

def poke(down: Int, value: Any): Unit

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.

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.

Attributes

def pop(): Any

Removes the top element from the stack and returns it. Throws a ValueStackUnderflowException if the stack is empty.

Removes the top element from the stack and returns it. Throws a ValueStackUnderflowException if the stack is empty.

Attributes

def pullOut(down: Int): Any

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.

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.

Attributes

def push(value: Any): Unit

Puts the given value onto the stack. Throws a ValueStackOverflowException if the stack has no more space available.

Puts the given value onto the stack. Throws a ValueStackOverflowException if the stack has no more space available.

Attributes

final def pushAll(hlist: HList): Unit

Puts the given HList of values onto the stack. Throws a ValueStackOverflowException if the stack has no more space available.

Puts the given HList of values onto the stack. Throws a ValueStackOverflowException if the stack has no more space available.

Attributes

def show: String

Creates a string representation of the current value stack contents. Mostly useful for debugging.

Creates a string representation of the current value stack contents. Mostly useful for debugging.

Attributes

override def size: Int

The number of elements currently on the stack.

The number of elements currently on the stack.

Attributes

Definition Classes
IterableOnceOps
def swap(): Unit

Swaps the top 2 stack elements. Throws a ValueStackUnderflowException if size < 2.

Swaps the top 2 stack elements. Throws a ValueStackUnderflowException if size < 2.

Attributes

def swap3(): Unit

Swaps the top 3 stack elements. Throws a ValueStackUnderflowException if size < 3.

Swaps the top 3 stack elements. Throws a ValueStackUnderflowException if size < 3.

Attributes

def swap4(): Unit

Swaps the top 4 stack elements. Throws a ValueStackUnderflowException if size < 4.

Swaps the top 4 stack elements. Throws a ValueStackUnderflowException if size < 4.

Attributes

def swap5(): Unit

Swaps the top 5 stack elements. Throws a ValueStackUnderflowException if size < 5.

Swaps the top 5 stack elements. Throws a ValueStackUnderflowException if size < 5.

Attributes

def toArray: Array[Any]

Returns all current stack elements as a new array.

Returns all current stack elements as a new array.

Attributes

final def toHList[L <: HList](start: Int, end: Int, prependTo: HList): L

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.

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.

Attributes

Inherited methods

final def ++[B >: Any](suffix: IterableOnce[B]): CC[B]

Attributes

Inherited from:
IterableOps
final def addString(b: StringBuilder): StringBuilder

Attributes

Inherited from:
IterableOnceOps
final def addString(b: StringBuilder, sep: String): StringBuilder

Attributes

Inherited from:
IterableOnceOps
def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

Attributes

Inherited from:
IterableOnceOps
def collect[B](pf: PartialFunction[Any, B]): CC[B]

Attributes

Inherited from:
IterableOps
def collectFirst[B](pf: PartialFunction[Any, B]): Option[B]

Attributes

Inherited from:
IterableOnceOps
def concat[B >: Any](suffix: IterableOnce[B]): CC[B]

Attributes

Inherited from:
IterableOps
def copyToArray[B >: Any](xs: Array[B], start: Int, len: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: Any](xs: Array[B], start: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: Any](xs: Array[B]): Int

Attributes

Inherited from:
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (Any, B) => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def count(p: Any => Boolean): Int

Attributes

Inherited from:
IterableOnceOps
def drop(n: Int): C

Attributes

Inherited from:
IterableOps
def dropRight(n: Int): C

Attributes

Inherited from:
IterableOps
def dropWhile(p: Any => Boolean): C

Attributes

Inherited from:
IterableOps
override def empty: CC[A]

Attributes

Definition Classes
IterableFactoryDefaults -> IterableOps
Inherited from:
IterableFactoryDefaults
def exists(p: Any => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def filter(pred: Any => Boolean): C

Attributes

Inherited from:
IterableOps
def filterNot(pred: Any => Boolean): C

Attributes

Inherited from:
IterableOps
def find(p: Any => Boolean): Option[A]

Attributes

Inherited from:
IterableOnceOps
def flatMap[B](f: Any => IterableOnce[B]): CC[B]

Attributes

Inherited from:
IterableOps
def flatten[B](implicit asIterable: Any => IterableOnce[B]): CC[B]

Attributes

Inherited from:
IterableOps
def fold[A1 >: Any](z: A1)(op: (A1, A1) => A1): A1

Attributes

Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, Any) => B): B

Attributes

Inherited from:
IterableOnceOps
def foldRight[B](z: B)(op: (Any, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def forall(p: Any => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def foreach[U](f: Any => U): Unit

Attributes

Inherited from:
IterableOnceOps
protected def fromSpecific(coll: IterableOnce[Any]): CC[A]

Attributes

Inherited from:
IterableFactoryDefaults
def groupBy[K](f: Any => K): Map[K, C]

Attributes

Inherited from:
IterableOps
def groupMap[K, B](key: Any => K)(f: Any => B): Map[K, CC[B]]

Attributes

Inherited from:
IterableOps
def groupMapReduce[K, B](key: Any => K)(f: Any => B)(reduce: (B, B) => B): Map[K, B]

Attributes

Inherited from:
IterableOps
def grouped(size: Int): Iterator[C]

Attributes

Inherited from:
IterableOps
def head: A

Attributes

Inherited from:
IterableOps
def headOption: Option[A]

Attributes

Inherited from:
IterableOps
def init: C

Attributes

Inherited from:
IterableOps
def inits: Iterator[C]

Attributes

Inherited from:
IterableOps
override def isTraversableAgain: Boolean

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
def iterableFactory: IterableFactory[Iterable]

Attributes

Inherited from:
Iterable
def knownSize: Int

Attributes

Inherited from:
IterableOnce
def last: A

Attributes

Inherited from:
IterableOps
def lastOption: Option[A]

Attributes

Inherited from:
IterableOps
def lazyZip[B](that: Iterable[B]): LazyZip2[A, B, Iterable]

Attributes

Inherited from:
Iterable
def map[B](f: Any => B): CC[B]

Attributes

Inherited from:
IterableOps
def max[B >: Any](implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def maxBy[B](f: Any => B)(implicit cmp: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def maxByOption[B](f: Any => B)(implicit cmp: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def maxOption[B >: Any](implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def min[B >: Any](implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def minBy[B](f: Any => B)(implicit cmp: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def minByOption[B](f: Any => B)(implicit cmp: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def minOption[B >: Any](implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
final def mkString: String

Attributes

Inherited from:
IterableOnceOps
final def mkString(sep: String): String

Attributes

Inherited from:
IterableOnceOps
final def mkString(start: String, sep: String, end: String): String

Attributes

Inherited from:
IterableOnceOps
protected def newSpecificBuilder: Builder[A, CC[A]]

Attributes

Inherited from:
IterableFactoryDefaults
def nonEmpty: Boolean

Attributes

Inherited from:
IterableOnceOps
def partition(p: Any => Boolean): (C, C)

Attributes

Inherited from:
IterableOps
def partitionMap[A1, A2](f: Any => Either[A1, A2]): (CC[A1], CC[A2])

Attributes

Inherited from:
IterableOps
def product[B >: Any](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def reduce[B >: Any](op: (B, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeft[B >: Any](op: (B, Any) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeftOption[B >: Any](op: (B, Any) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceOption[B >: Any](op: (B, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceRight[B >: Any](op: (Any, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceRightOption[B >: Any](op: (Any, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
protected def reversed: Iterable[A]

Attributes

Inherited from:
IterableOnceOps
def scan[B >: Any](z: B)(op: (B, B) => B): CC[B]

Attributes

Inherited from:
IterableOps
def scanLeft[B](z: B)(op: (B, Any) => B): CC[B]

Attributes

Inherited from:
IterableOps
def scanRight[B](z: B)(op: (Any, B) => B): CC[B]

Attributes

Inherited from:
IterableOps
def sizeCompare(that: Iterable[_]): Int

Attributes

Inherited from:
IterableOps
def sizeCompare(otherSize: Int): Int

Attributes

Inherited from:
IterableOps
final def sizeIs: SizeCompareOps

Attributes

Inherited from:
IterableOps
def slice(from: Int, until: Int): C

Attributes

Inherited from:
IterableOps
def sliding(size: Int, step: Int): Iterator[C]

Attributes

Inherited from:
IterableOps
def sliding(size: Int): Iterator[C]

Attributes

Inherited from:
IterableOps
def span(p: Any => Boolean): (C, C)

Attributes

Inherited from:
IterableOps
override def splitAt(n: Int): (C, C)

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[Any, S]): S

Attributes

Inherited from:
IterableOnce
def sum[B >: Any](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def tail: C

Attributes

Inherited from:
IterableOps
def tails: Iterator[C]

Attributes

Inherited from:
IterableOps
def take(n: Int): C

Attributes

Inherited from:
IterableOps
def takeRight(n: Int): C

Attributes

Inherited from:
IterableOps
def takeWhile(p: Any => Boolean): C

Attributes

Inherited from:
IterableOps
override def tapEach[U](f: Any => U): C

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
def to[C1](factory: Factory[Any, C1]): C1

Attributes

Inherited from:
IterableOnceOps
def toArray[B >: Any : ClassTag]: Array[B]

Attributes

Inherited from:
IterableOnceOps
final def toBuffer[B >: Any]: Buffer[B]

Attributes

Inherited from:
IterableOnceOps
def toIndexedSeq: IndexedSeq[A]

Attributes

Inherited from:
IterableOnceOps
def toList: List[A]

Attributes

Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: Any <:< (K, V)): Map[K, V]

Attributes

Inherited from:
IterableOnceOps
def toSeq: Seq[A]

Attributes

Inherited from:
IterableOnceOps
def toSet[B >: Any]: Set[B]

Attributes

Inherited from:
IterableOnceOps
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Iterable -> Any
Inherited from:
Iterable
def toVector: Vector[A]

Attributes

Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: Any => Iterable[B]): CC[CC[B]]

Attributes

Inherited from:
IterableOps
def unzip[A1, A2](implicit asPair: Any => (A1, A2)): (CC[A1], CC[A2])

Attributes

Inherited from:
IterableOps
def unzip3[A1, A2, A3](implicit asTriple: Any => (A1, A2, A3)): (CC[A1], CC[A2], CC[A3])

Attributes

Inherited from:
IterableOps
def view: View[A]

Attributes

Inherited from:
IterableOps
def withFilter(p: Any => Boolean): WithFilter[A, CC]

Attributes

Inherited from:
IterableOps
def zip[B](that: IterableOnce[B]): CC[(A, B)]

Attributes

Inherited from:
IterableOps
def zipAll[A1 >: Any, B](that: Iterable[B], thisElem: A1, thatElem: B): CC[(A1, B)]

Attributes

Inherited from:
IterableOps
def zipWithIndex: CC[(A, Int)]

Attributes

Inherited from:
IterableOps

Deprecated and Inherited methods

def ++:[B >: Any](that: IterableOnce[B]): CC[B]

Attributes

Deprecated
[Since version 2.13.0] Use ++ instead of ++: for collections of type Iterable
Inherited from:
IterableOps
final def /:[B](z: B)(op: (B, Any) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
final def :\[B](z: B)(op: (Any, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
def aggregate[B](z: => B)(seqop: (B, Any) => B, combop: (B, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] `aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.
Inherited from:
IterableOnceOps
def companion: IterableFactory[CC]

Attributes

Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
final def copyToBuffer[B >: Any](dest: Buffer[B]): Unit

Attributes

Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps
def hasDefiniteSize: Boolean

Attributes

Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
final def repr: C

Attributes

Deprecated
[Since version 2.13.0] Use coll instead of repr in a collection implementation, use the collection value itself from the outside
Inherited from:
IterableOps
def seq: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
final def toIterable: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.7] toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
Iterable
final def toIterator: Iterator[A]

Attributes

Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
final def toStream: Stream[A]

Attributes

Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps
final def toTraversable: Iterable[A]

Attributes

Deprecated
[Since version 2.13.0] toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
IterableOps
def view(from: Int, until: Int): View[A]

Attributes

Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Inherited from:
IterableOps