Packages

  • package root

    This is the documentation for Parsley.

    This is the documentation for Parsley.

    Package structure

    The parsley package contains the Parsley class, as well as the Result, Success, and Failure types. In addition to these, it also contains the following packages and "modules" (a module is defined as being an object which mocks a package):

    • parsley.Parsley contains the bulk of the core "function-style" combinators, as well as the implicit classes which enable the "method-style" combinators.
    • parsley.combinator contains many helpful combinators that simplify some common parser patterns.
    • parsley.character contains the combinators needed to read characters and strings, as well as combinators to match specific sub-sets of characters.
    • parsley.debug contains debugging combinators, helpful for identifying faults in parsers.
    • parsley.io contains extension methods to run parsers with input sourced from IO sources.
    • parsley.expr contains the following sub modules:
    • parsley.implicits contains several implicits to add syntactic sugar to the combinators. These are sub-categorised into the following sub modules:
      • parsley.implicits.character contains implicits to allow you to use character and string literals as parsers.
      • parsley.implicits.combinator contains implicits related to combinators, such as the ability to make any parser into a Parsley[Unit] automatically.
      • parsley.implicits.lift enables postfix application of the lift combinator onto a function (or value).
      • parsley.implicits.zipped enables boths a reversed form of lift where the function appears on the right and is applied on a tuple (useful when type inference has failed) as well as a .zipped method for building tuples out of several combinators.
    • parsley.errors contains modules to deal with error messages, their refinement and generation.
      • parsley.errors.combinator provides combinators that can be used to either produce more detailed errors as well as refine existing errors.
    • parsley.lift contains functions which lift functions that work on regular types to those which now combine the results of parsers returning those same types. these are ubiquitous.
    • parsley.registers contains combinators that interact with the context-sensitive functionality in the form of registers.
    • parsley.token contains the Lexer class that provides a host of helpful lexing combinators when provided with the description of a language.
    • parsley.unsafe contains unsafe (and not thread-safe) ways of speeding up the execution of a parser.
    Definition Classes
    root
  • package parsley
    Definition Classes
    root
  • package errors
    Definition Classes
    parsley
  • package expr
    Definition Classes
    parsley
  • package implicits
    Definition Classes
    parsley
  • package token
    Definition Classes
    parsley
  • Failure
  • Parsley
  • Result
  • Success
  • character
  • combinator
  • debug
  • io
  • lift
  • registers
  • unsafe
o

parsley

character

object character

This module contains many parsers to do with reading one or more characters. Almost every parser will need something from this module.

Since

2.2.0

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

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. val alphaNum: Parsley[Char]

    Parses a letter or digit.

    Parses a letter or digit. Returns the parsed character.

  5. val anyChar: Parsley[Char]

    The parser anyChar accepts any kind of character.

    The parser anyChar accepts any kind of character. Returns the accepted character.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def char(c: Char): Parsley[Char]

    Reads a character from the input stream and returns it, else fails if the character is not found at the head of the stream.

    Reads a character from the input stream and returns it, else fails if the character is not found at the head of the stream.

    c

    The character to search for

    returns

    c if it can be found at the head of the input

  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. val crlf: Parsley[Char]

    Parses a carriage return character '\r' followed by a newline character '\n', returns the newline character.

  10. val digit: Parsley[Char]

    Parses a digit.

    Parses a digit. Returns the parsed character.

  11. val endOfLine: Parsley[Char]

    Parses a CRLF or LF end-of-line.

    Parses a CRLF or LF end-of-line. Returns a newline character ('\n').

  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. val hexDigit: Parsley[Char]

    Parses a hexadecimal digit.

    Parses a hexadecimal digit. Returns the parsed character.

  18. def isHexDigit(c: Char): Boolean

    Helper function, equivalent to the predicate used by hexDigit.

    Helper function, equivalent to the predicate used by hexDigit. Useful for providing to LanguageDef

  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def isOctDigit(c: Char): Boolean

    Helper function, equivalent to the predicate used by octDigit.

    Helper function, equivalent to the predicate used by octDigit. Useful for providing to LanguageDef

  21. def isSpace(c: Char): Boolean

    Helper function, equivalent to the predicate used by space.

    Helper function, equivalent to the predicate used by space. Useful for providing to LanguageDef

  22. def isWhitespace(c: Char): Boolean

    Helper function, equivalent to the predicate used by whitespace.

    Helper function, equivalent to the predicate used by whitespace. Useful for providing to LanguageDef

  23. val letter: Parsley[Char]

    Parses a letter.

    Parses a letter. Returns the parsed character.

  24. val lower: Parsley[Char]

    Parses a lower case letter.

    Parses a lower case letter. Returns the parsed character.

  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. val newline: Parsley[Char]

    Parses a newline character ('\n').

    Parses a newline character ('\n'). Returns a newline character.

  27. def noneOf(cs: Char*): Parsley[Char]

    As the dual of oneOf, noneOf(cs) succeeds if the current character is not in the supplied sequence of characters cs.

    As the dual of oneOf, noneOf(cs) succeeds if the current character is not in the supplied sequence of characters cs. Returns the parsed character.

  28. def noneOf(cs: Set[Char]): Parsley[Char]

    As the dual of oneOf, noneOf(cs) succeeds if the current character is not in the supplied set of characters cs.

    As the dual of oneOf, noneOf(cs) succeeds if the current character is not in the supplied set of characters cs. Returns the parsed character.

  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. val octDigit: Parsley[Char]

    Parses an octal digit.

    Parses an octal digit. Returns the parsed character.

  32. def oneOf(cs: Char*): Parsley[Char]

    oneOf(cs) succeeds if the current character is in the supplied sequence of characters cs.

    oneOf(cs) succeeds if the current character is in the supplied sequence of characters cs. Returns the parsed character. See also satisfy.

  33. def oneOf(cs: Set[Char]): Parsley[Char]

    oneOf(cs) succeeds if the current character is in the supplied set of characters cs.

    oneOf(cs) succeeds if the current character is in the supplied set of characters cs. Returns the parsed character. See also satisfy.

  34. def satisfy(f: (Char) => Boolean): Parsley[Char]

    Reads a character from the head of the input stream if and only if it satisfies the given predicate.

    Reads a character from the head of the input stream if and only if it satisfies the given predicate. Else it fails without consuming the character.

    f

    The function to test the character on

    returns

    c if f(c) is true.

  35. val space: Parsley[Char]

    Parses a whitespace character (either ' ' or '\t').

    Parses a whitespace character (either ' ' or '\t'). Returns the parsed character.

  36. val spaces: Parsley[Unit]

    Skips zero or more whitespace characters.

    Skips zero or more whitespace characters. See also skipMany. Uses space.

  37. def string(s: String): Parsley[String]

    Reads a string from the input stream and returns it, else fails if the string is not found at the head of the stream.

    Reads a string from the input stream and returns it, else fails if the string is not found at the head of the stream.

    s

    The string to match against

    returns

    s if it can be found at the head of the input

  38. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  39. val tab: Parsley[Char]

    Parses a tab character ('\t').

    Parses a tab character ('\t'). Returns a tab character.

  40. def toString(): String
    Definition Classes
    AnyRef → Any
  41. val upper: Parsley[Char]

    Parses an upper case letter.

    Parses an upper case letter. Returns the parsed character.

  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  45. val whitespace: Parsley[Char]

    Parses a whitespace character (' ', '\t', '\n', '\r', '\f', '\v').

    Parses a whitespace character (' ', '\t', '\n', '\r', '\f', '\v'). Returns the parsed character.

  46. val whitespaces: Parsley[Unit]

    Skips zero or more whitespace characters.

    Skips zero or more whitespace characters. See also skipMany. Uses whitespace.

Inherited from AnyRef

Inherited from Any

Ungrouped