Packages

object ContextMatcher

Source
ContextMatcher.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ContextMatcher
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. case class Chained[Elem, H, T, F](headM: ContextMatcher[Elem, H], tailM: ContextMatcher[Elem, T])(implicit reduce: Aux[H, T, F]) extends ContextMatcher[Elem, F] with Product with Serializable

    Matcher implementation for headM \ tailM

    Matcher implementation for headM \ tailM

    H

    The head result type

    T

    The tail result type

    F

    The combined result type

    headM

    The first matcher in the chain

    tailM

    The next matcher in the chain

    reduce

    The TypeReduce rule to combine the head and tail result types

  2. case class Mapped[Elem, A, B](inner: ContextMatcher[Elem, A], op: String = "map")(f: (A) => Option[B]) extends ContextMatcher[Elem, B] with Product with Serializable

    Matcher implementation for the map, flatMap, and filter operations.

    Matcher implementation for the map, flatMap, and filter operations.

    A

    The type of the matched context.

    B

    The transformed context type

    inner

    The transformed mapper

    op

    The name of the operation, used by toString

    f

    The transform operation

  3. case class Or[Elem, A](left: ContextMatcher[Elem, A], right: ContextMatcher[Elem, A]) extends ContextMatcher[Elem, A] with Product with Serializable

    Matcher implementation for left | right.

    Matcher implementation for left | right.

    A

    The type of the matched context.

    left

    The left matcher (i.e. the first choice)

    right

    The right matcher (i.e. the fallback)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  9. def greedy[Elem, A](f: (IndexedSeq[Elem], Int, Int) => Option[(A, Int)]): ContextMatcher[Elem, A]

    A matcher that uses a custom function f to consume the first N elements from the input before passing the remainder to the next matcher in the chain.

    A matcher that uses a custom function f to consume the first N elements from the input before passing the remainder to the next matcher in the chain.

    For example:

    Matcher.greedy { (stack, offset, avail) =>
      if(avail >= 2 && stack(offset) == "foo" && stack(offset + 1) == "bar"){
        Some("yes!" -> 2)
      } else {
        None
      }
    }
    A

    The matcher function's result type

    f

    The matching function. Given a reference to the stack elements, an offset position, and the number of elements available starting from the offset, f should return an option containing a pair of the matched value and the unconsumed portion of the stack.

    returns

    A new matcher which uses f to determine how (and how much of) the stack is matched

  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def noopFailure[Elem]: ContextMatcher[Elem, Unit]

    A matcher that quickly rejects any input

  14. def noopSuccess[Elem]: ContextMatcher[Elem, Unit]

    A matcher that quickly matches any input as () without consuming any stack.

  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. def variableLength[Elem]: ContextMatcher[Elem, Unit]

    A matcher that matches any input as long as the next matcher in the chain will match some segment of that input.

  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped