molecule.parsers.charbuffer.RegexParsers

LitteralParser

class LitteralParser extends Parser[CharBuffer, String]

Source
RegexParsers.scala
Linear Supertypes
Parser[CharBuffer, String], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. LitteralParser
  2. Parser
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LitteralParser(idx: Int, s: String, acc: List[String], skipWhiteSpaces: Boolean)

Type Members

  1. type Res = ParseResult[String, CharBuffer]

    Attributes
    protected
    Definition Classes
    Parser

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def *(implicit parsers: Parsers[CharBuffer]): Parser[CharBuffer, Seg[String]]

    Returns a parser that repeatedly parses what this parser parses

    Returns a parser that repeatedly parses what this parser parses

    returns

    rep(this)

    Definition Classes
    Parser
  5. def +(implicit parsers: Parsers[CharBuffer]): Parser[CharBuffer, Seg[String]]

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

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

    returns

    rep1(this)

    Definition Classes
    Parser
  6. def <~[U](p: ⇒ Parser[CharBuffer, U]): Parser[CharBuffer, String]

    A parser combinator for sequential composition which keeps only the left result

    A parser combinator for sequential composition which keeps only the left result

    p <~ q' succeeds if p' succeeds and q' succeeds on the input left over by p'.

    Note: <~ has lower operator precedence than ~ or ~>.

    returns

    a Parser' that -- on success -- returns the result of p'.

    Definition Classes
    Parser
  7. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  9. def ?(implicit parsers: Parsers[CharBuffer]): Parser[CharBuffer, Option[String]]

    Returns a parser that optionally parses what this parser parses.

    Returns a parser that optionally parses what this parser parses.

    returns

    opt(this)

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

    A parser combinator for function application

    A parser combinator for function application

    p ^^ f' succeeds if p' succeeds; it returns f' applied to the result of p'.

    f

    a function that will be applied to this parser's result (see map' in ParseResult').

    returns

    a parser that has the same behaviour as the current parser, but whose result is transformed by f'.

    Definition Classes
    Parser
  11. def ^^^[U](r: U): Parser[CharBuffer, U]

    A parser combinator for substituting a result with another

    A parser combinator for substituting a result with another

    p ^^^ r' succeeds if p' succeeds; it returns r'

    r

    the substitution result

    returns

    a parser that has the same behaviour as the current parser, but whose result is replaced by r'.

    Definition Classes
    Parser
  12. final def apply(se: Seg[CharBuffer]): Res

    Apply this parser to the next segment.

    Apply this parser to the next segment.

    returns

    a parse result

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

    Definition Classes
    Any
  14. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. def collect[C](f: PartialFunction[String, C]): Parser[CharBuffer, C]

    Definition Classes
    Parser
  16. def contraMap[Z](g: (Z) ⇒ CharBuffer, consume: (Z, CharBuffer) ⇒ Z): Parser[Z, String]

    transforms this of type Parser[A,B] into a parser of type Parser[Z,B].

    transforms this of type Parser[A,B] into a parser of type Parser[Z,B].

    g

    function that maps a message of type Z into a message of type A. Given an input stream ichan: IChan[Z] and a parser: Parser[A,B], the stream transformation ichan.parse(parser.contraMap(g,h)) is equivalent to ichan.map(g).parse(parser). The reason for contraMap is to be able to apply g until a first parsed result on a input:Input[Z]; input.read(parser.contraMap(g,h)) will leave, after reading the first parsed result, the stream untouched and of type Z, so one map want to apply another parser of type Parser[Z,C] afterwards.

    consume

    function to generate a partially consumed message type Z in case the inverse function of g does not exists. A parser may partially consume a message of an input stream. So if this leaves a partially consumed message of type A on the stream, an equally consumed message of type Z will generated with function consume. In the function consume(z:A,a:A):Z, z is the message to be partially consumed, a is the partially consume value of g(z); the return value must be the partially consume z such that g( consume(z,a) ) == a and when g(z) == a than consume(z,a) == z If consume is not correctly specified, the contraMapped parser may give unexpected results in case of partially consumed messages.

    returns

    a contraMapped parser

    Definition Classes
    Parser
  17. def contraMapReversible[Z](g: (Z) ⇒ CharBuffer, h: (CharBuffer) ⇒ Z): Parser[Z, String]

    transforms this of type Parser[A,B] into a parser of type Parser[Z,B].

    transforms this of type Parser[A,B] into a parser of type Parser[Z,B].

    g

    function that maps a message of type Z into a message of type A. Given an input stream ichan: IChan[Z] and a parser: Parser[A,B], the stream transformation ichan.parse(parser.contraMap(g,h)) is equivalent to ichan.map(g).parse(parser). The reason for contraMap is to be able to apply g until a first parsed result on a input:Input[Z]; input.read(parser.contraMap(g,h)) will leave, after reading the first parsed result, the stream untouched and of type Z, so one map want to apply another parser of type Parser[Z,C] afterwards.

    h

    inverse function of g. A parser may partially consume a message of an input stream. So if this leaves a partially consumed message of type A on the stream, that message will be reverse mapped to Z with function h. If h(g(a)) is not equal to a, the contraMapped parser may give unexpected results in case of partially consumed messages. In case the function h is not defined, one must use contraMap[Z](g: Z => A, consume:(Z,A) => Z): Parser[Z, B].

    returns

    a contraMapped parser

    Definition Classes
    Parser
  18. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  20. final def filter(p: (String) ⇒ Boolean): Parser[CharBuffer, String]

    Filter results of this parser.

    Filter results of this parser.

    p

    predicate that returns true for results accepted by this parser

    returns

    a filtered parser

    Definition Classes
    Parser
  21. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  22. def flatMap[C](f: (String) ⇒ Parser[CharBuffer, C]): Parser[CharBuffer, C]

    Sequence with a second parsers only after this one produced a result.

    Sequence with a second parsers only after this one produced a result.

    returns

    the resulting parser

    Definition Classes
    Parser
  23. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  24. def hashCode(): Int

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

    Definition Classes
    Any
  26. final def map[C](f: (String) ⇒ C): Parser[CharBuffer, C]

    Map the result of this parser to another result C

    Map the result of this parser to another result C

    Definition Classes
    Parser
  27. def name: String

    The name of this parser (used for debugging)

    The name of this parser (used for debugging)

    returns

    name of this parser

    Definition Classes
    LitteralParserParser
  28. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  31. def reset: Parser[CharBuffer, String]

  32. def result(signal: Signal): Some[Left[Fail, Nothing]]

    Request result because there is no more data

    Request result because there is no more data

    Definition Classes
    LitteralParserParser
  33. final def result(seg: Seg[CharBuffer], signal: Signal): Option[Either[Fail, Done[String, CharBuffer]]]

    Apply this parser to the last segment.

    Apply this parser to the last segment.

    seg

    the segment to parse for a new message

    signal

    the signal accompanying the last segment

    returns

    Nothing if there is no new message left. Some Fail or Done depending on if the last parse failed or succeeded.

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

    Definition Classes
    AnyRef
  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  39. def |[U >: String](alternative: ⇒ Parser[CharBuffer, U]): Parser[CharBuffer, U]

    A parser combinator for alternative composition

    A parser combinator for alternative composition

    p | q' succeeds if p' succeeds or q' succeeds Note that q' is only tried if p's failure is non-fatal (i.e., back-tracking is allowed).

    returns

    a Parser' that returns the result of the first parser to succeed (out of p' and q') The resulting parser succeeds if (and only if)

    • p' succeeds, or
    • if p' fails allowing back-tracking and q' succeeds.
    Definition Classes
    Parser
  40. def ~[U](p: ⇒ Parser[CharBuffer, U]): Parser[CharBuffer, ~[String, U]]

    A parser combinator for sequential composition

    A parser combinator for sequential composition

    p ~ q' succeeds if p' succeeds and q' succeeds on the input left over by p'.

    returns

    a Parser' that -- on success -- returns a ~' (like a Pair, but easier to pattern match on) that contains the result of p' and that of q'. The resulting parser fails if either p' or q' fails.

    Definition Classes
    Parser
  41. def ~>[U](p: ⇒ Parser[CharBuffer, U]): Parser[CharBuffer, U]

    A parser combinator for sequential composition which keeps only the right result

    A parser combinator for sequential composition which keeps only the right result

    p ~> q' succeeds if p' succeeds and q' succeeds on the input left over by p'.

    returns

    a Parser' that -- on success -- returns the result of q'.

    Definition Classes
    Parser

Inherited from Parser[CharBuffer, String]

Inherited from AnyRef

Inherited from Any