Object/Trait

io.dylemma.spac

ContextMatcher

Related Docs: trait ContextMatcher | package spac

Permalink

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

Type Members

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

    Permalink

    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[A, B](inner: ContextMatcher[A], op: String = "map")(f: (A) ⇒ Option[B]) extends ContextMatcher[B] with Product with Serializable

    Permalink

    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[A](left: ContextMatcher[A], right: ContextMatcher[A]) extends ContextMatcher[A] with Product with Serializable

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def greedy[A](f: (IndexedSeq[StartElement], Int, Int) ⇒ Option[(A, Int)]): ContextMatcher[A]

    Permalink

    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

  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. val noopFailure: ContextMatcher[Unit]

    Permalink

    A matcher that quickly rejects any input

  15. val noopSuccess: ContextMatcher[Unit]

    Permalink

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

  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. val variableLength: ContextMatcher[Unit]

    Permalink

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

  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped