Class

laika.parse.text

Literal

Related Doc: package text

Permalink

case class Literal(expected: String) extends Parser[String] with Product with Serializable

A parser that matches a literal string.

Linear Supertypes
Serializable, Serializable, Product, Equals, Parser[String], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Literal
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Parser
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Literal(expected: String)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def *: Repeat[String]

    Permalink

    Returns a parser that repeatedly applies this parser.

    Returns a parser that repeatedly applies this parser. It will always succeed, potentially with an empty list as the result.

    Definition Classes
    Parser
  4. def +: Repeat[String]

    Permalink

    Returns a parser that repeatedly applies this parser (at least once).

    Returns a parser that repeatedly applies this parser (at least once).

    Definition Classes
    Parser
  5. def <~[U](p: Parser[U]): Parser[String]

    Permalink

    Applies the specified parser to the input left over by this parser, but only keeps the left result.

    Applies the specified parser to the input left over by this parser, but only keeps the left result.

    a <~ b only succeeds if both parsers succeed.

    Definition Classes
    Parser
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. def >>[U](fq: (String) ⇒ Parser[U]): Parser[U]

    Permalink

    Operator synonym for flatMap.

    Operator synonym for flatMap.

    Definition Classes
    Parser
  8. def ?: Parser[Option[String]]

    Permalink

    Returns a parser that optionally parses what this parser parses.

    Returns a parser that optionally parses what this parser parses.

    Definition Classes
    Parser
  9. def ^?[U](f: PartialFunction[String, U], error: (String) ⇒ String = ...): Parser[U]

    Permalink

    Returns a parser that applies a partial function to the result of this parser.

    Returns a parser that applies a partial function to the result of this parser.

    p ^? f succeeds if p succeeds and f is defined at the result of p, In that case it returns f applied to the result of p.

    f

    a partial function that will be applied to this parser's result.

    error

    an optional function that takes the same argument as f and produces an error message.

    Definition Classes
    Parser
  10. def ^^[U](f: (String) ⇒ U): Parser[U]

    Permalink

    A synonym for map, allowing the grammar to be declared in a concise way.

    A synonym for map, allowing the grammar to be declared in a concise way.

    Definition Classes
    Parser
  11. def ^^?[U](f: (String) ⇒ Either[String, U]): Parser[U]

    Permalink

    Returns a parser that applies a function to the result of this parser producing an Either where Left is interpreted as failure.

    Returns a parser that applies a function to the result of this parser producing an Either where Left is interpreted as failure. It is an alternative to ^? for scenarios where the conditional check cannot be easily performed in a pattern match.

    p ^^? f succeeds if p succeeds and f returns a Right when applied to the result of p.

    Definition Classes
    Parser
  12. def ^^^[U](v: ⇒ U): Parser[U]

    Permalink

    Returns a parser that ignores the result of this parser (if it succeeds) and returns the specified result instead.

    Returns a parser that ignores the result of this parser (if it succeeds) and returns the specified result instead.

    Subclasses may override this method to avoid any expensive result processing.

    Definition Classes
    Parser
  13. final def asInstanceOf[T0]: T0

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

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

    Permalink
    Definition Classes
    AnyRef
  16. val expected: String

    Permalink
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def flatMap[U](f: (String) ⇒ Parser[U]): Parser[U]

    Permalink

    Builds a new parser by applying the specified function to the result of this parser and subsequently applying the parser returned by that function to the input left over by this parser.

    Builds a new parser by applying the specified function to the result of this parser and subsequently applying the parser returned by that function to the input left over by this parser.

    Definition Classes
    Parser
  19. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    Any
  21. def map[U](f: (String) ⇒ U): Parser[U]

    Permalink

    Builds a new parser by applying the specified function to the result of this parser.

    Builds a new parser by applying the specified function to the result of this parser.

    Definition Classes
    Parser
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  25. def orElse[U >: String](p0: ⇒ Parser[U]): Parser[U]

    Permalink

    Applies the specified parser when this parser fails.

    Applies the specified parser when this parser fails.

    a orElse b succeeds if either of the parsers succeeds.

    Implementation note: The parameter is by-name to allow the definition of recursive parsers. In contrast to the former SDK parser combinators this is the only place where a parser with a by-name parameter is used whereas in all other places the additional cost is avoided.

    Definition Classes
    Parser
  26. def parse(in: ParserContext): Parsed[String]

    Permalink

    Parses the string content in the specified context and returns the result.

    Parses the string content in the specified context and returns the result.

    This is the only abstract method in Parser that concrete implementations need to implement.

    Definition Classes
    LiteralParser
  27. def parse(in: String): Parsed[String]

    Permalink

    Parses the specified string and returns the result.

    Parses the specified string and returns the result.

    Definition Classes
    Parser
  28. def rep: Repeat[String]

    Permalink

    Returns a parser that repeatedly applies this parser.

    Returns a parser that repeatedly applies this parser. The returned parser offers an API to specify further constraints like min or max.

    Definition Classes
    Parser
  29. def repWith[U >: String](next: (U) ⇒ Parser[U]): Parser[List[U]]

    Permalink

    Returns a parser that invokes the specified function repeatedly, passing the result of this parser if it succeeds, to produce new parsers that get applied until one of them fails.

    Returns a parser that invokes the specified function repeatedly, passing the result of this parser if it succeeds, to produce new parsers that get applied until one of them fails.

    The result of the returned parser is a list containing the result of this parser (if it succeeds) plus the results of successful invocations of the parsers returned by the specified function.

    Definition Classes
    Parser
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. def withFailureMessage(msg: String): Parser[String]

    Permalink

    Changes the failure message produced by a parser.

    Changes the failure message produced by a parser.

    Definition Classes
    Parser
  35. def |[U >: String](p: ⇒ Parser[U]): Parser[U]

    Permalink

    Applies the specified parser when this parser fails.

    Applies the specified parser when this parser fails.

    a | b succeeds if either of the parsers succeeds.

    Implementation note: The parameter is by-name to allow the definition of recursive parsers. In contrast to the former SDK parser combinators this is the only place where a parser with a by-name parameter is used whereas in all other places the additional cost is avoided.

    Definition Classes
    Parser
  36. def ~[U](p: Parser[U]): Parser[~[String, U]]

    Permalink

    Applies the specified parser to the input left over by this parser and combines the two results.

    Applies the specified parser to the input left over by this parser and combines the two results.

    a ~ b only succeeds if both parsers succeed, with the results in a wrapper class named ~ for convenient pattern matching:

    a ~ b ~ c ^^ {
      case a ~ b ~ c => processResult(a, b, c)
    }
    Definition Classes
    Parser
  37. def ~>[U](p: Parser[U]): Parser[U]

    Permalink

    Applies the specified parser to the input left over by this parser, but only keeps the right result.

    Applies the specified parser to the input left over by this parser, but only keeps the right result.

    a ~> b only succeeds if both parsers succeed.

    Definition Classes
    Parser

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Parser[String]

Inherited from AnyRef

Inherited from Any

Ungrouped