Class DebuggingValueStack<V>

java.lang.Object
org.parboiled.support.DefaultValueStack<V>
org.parboiled.support.DebuggingValueStack<V>
All Implemented Interfaces:
Iterable<V>, ValueStack<V>

public class DebuggingValueStack<V> extends DefaultValueStack<V>
  • Field Details

  • Constructor Details

    • DebuggingValueStack

      public DebuggingValueStack()
    • DebuggingValueStack

      public DebuggingValueStack(Sink<String> log)
    • DebuggingValueStack

      public DebuggingValueStack(Iterable<V> values)
    • DebuggingValueStack

      public DebuggingValueStack(Iterable<V> values, Sink<String> log)
  • Method Details

    • clear

      public void clear()
      Description copied from interface: ValueStack
      Clears all values.
      Specified by:
      clear in interface ValueStack<V>
      Overrides:
      clear in class DefaultValueStack<V>
    • restoreSnapshot

      public void restoreSnapshot(Object snapshot)
      Description copied from interface: ValueStack
      Restores the stack state as previously returned by ValueStack.takeSnapshot(). This cost of running this operation is negligible and independent from the size of the stack.
      Specified by:
      restoreSnapshot in interface ValueStack<V>
      Overrides:
      restoreSnapshot in class DefaultValueStack<V>
      Parameters:
      snapshot - a snapshot object previously returned by ValueStack.takeSnapshot()
    • push

      public void push(V value)
      Description copied from interface: ValueStack
      Pushes the given value onto the stack. Equivalent to push(0, value).
      Specified by:
      push in interface ValueStack<V>
      Overrides:
      push in class DefaultValueStack<V>
      Parameters:
      value - the value
    • push

      public void push(int down, V value)
      Description copied from interface: ValueStack
      Inserts the given value a given number of elements below the current top of the stack.
      Specified by:
      push in interface ValueStack<V>
      Overrides:
      push in class DefaultValueStack<V>
      Parameters:
      down - the number of elements to skip before inserting the value (0 being equivalent to push(value))
      value - the value
    • pop

      public V pop(int down)
      Description copied from interface: ValueStack
      Removes the value the given number of elements below the top of the stack.
      Specified by:
      pop in interface ValueStack<V>
      Overrides:
      pop in class DefaultValueStack<V>
      Parameters:
      down - the number of elements to skip before removing the value (0 being equivalent to pop())
      Returns:
      the value
    • poke

      public void poke(int down, V value)
      Description copied from interface: ValueStack
      Replaces the element the given number of elements below the current top of the stack.
      Specified by:
      poke in interface ValueStack<V>
      Overrides:
      poke in class DefaultValueStack<V>
      Parameters:
      down - the number of elements to skip before replacing the value (0 being equivalent to poke(value))
      value - the value to replace with
    • swap

      public void swap()
      Description copied from interface: ValueStack
      Swaps the top two stack values.
      Specified by:
      swap in interface ValueStack<V>
      Overrides:
      swap in class DefaultValueStack<V>
    • swap3

      public void swap3()
      Description copied from interface: ValueStack
      Reverses the order of the top 3 stack values.
      Specified by:
      swap3 in interface ValueStack<V>
      Overrides:
      swap3 in class DefaultValueStack<V>
    • swap4

      public void swap4()
      Description copied from interface: ValueStack
      Reverses the order of the top 4 stack values.
      Specified by:
      swap4 in interface ValueStack<V>
      Overrides:
      swap4 in class DefaultValueStack<V>
    • swap5

      public void swap5()
      Description copied from interface: ValueStack
      Reverses the order of the top 5 stack values.
      Specified by:
      swap5 in interface ValueStack<V>
      Overrides:
      swap5 in class DefaultValueStack<V>
    • swap6

      public void swap6()
      Description copied from interface: ValueStack
      Reverses the order of the top 5 stack values.
      Specified by:
      swap6 in interface ValueStack<V>
      Overrides:
      swap6 in class DefaultValueStack<V>