object Char
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This object will be removed in Parsley 3.0, use
parsley.character
instead
- Alphabetic
- By Inheritance
- Char
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- val alphaNum: Parsley[Char]
Parses a letter or digit.
Parses a letter or digit. Returns the parsed character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.alphaNum
instead
- val anyChar: Parsley[Char]
The parser
anyChar
accepts any kind of character.The parser
anyChar
accepts any kind of character. Returns the accepted character.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.anyChar
instead
- 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
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.char
instead
- val crlf: Parsley[Char]
Parses a carriage return character '\r' followed by a newline character '\n', returns the newline character.
Parses a carriage return character '\r' followed by a newline character '\n', returns the newline character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.crlf
instead
- val digit: Parsley[Char]
Parses a digit.
Parses a digit. Returns the parsed character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.digit
instead
- 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').
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.endOfLine
instead
- val hexDigit: Parsley[Char]
Parses a hexadecimal digit.
Parses a hexadecimal digit. Returns the parsed character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.hexDigit
instead
- 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
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.isHexDigit
instead
- 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
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.isOctDigit
instead
- 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
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.isSpace
instead
- 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
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.isWhitespace
instead
- val letter: Parsley[Char]
Parses a letter.
Parses a letter. Returns the parsed character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.letter
instead
- val lower: Parsley[Char]
Parses a lower case letter.
Parses a lower case letter. Returns the parsed character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.lower
instead
- val newline: Parsley[Char]
Parses a newline character ('\n').
Parses a newline character ('\n'). Returns a newline character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.newline
instead
- 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 characterscs
.As the dual of
oneOf
,noneOf(cs)
succeeds if the current character is not in the supplied sequence of characterscs
. Returns the parsed character.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.noneOf
instead
- 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 characterscs
.As the dual of
oneOf
,noneOf(cs)
succeeds if the current character is not in the supplied set of characterscs
. Returns the parsed character.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.noneOf
instead
- val octDigit: Parsley[Char]
Parses an octal digit.
Parses an octal digit. Returns the parsed character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.octDigit
instead
- def oneOf(cs: Char*): Parsley[Char]
oneOf(cs)
succeeds if the current character is in the supplied sequence of characterscs
.oneOf(cs)
succeeds if the current character is in the supplied sequence of characterscs
. Returns the parsed character. See alsosatisfy
.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.oneOf
instead
- def oneOf(cs: Set[Char]): Parsley[Char]
oneOf(cs)
succeeds if the current character is in the supplied set of characterscs
.oneOf(cs)
succeeds if the current character is in the supplied set of characterscs
. Returns the parsed character. See alsosatisfy
.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.oneOf
instead
- 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
iff(c)
is true.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.satisfy
instead
- val space: Parsley[Char]
Parses a whitespace character (either ' ' or '\t').
Parses a whitespace character (either ' ' or '\t'). Returns the parsed character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.space
instead
- val spaces: Parsley[Unit]
Skips zero or more whitespace characters.
Skips zero or more whitespace characters. See also
skipMany
. Uses space.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.spaces
instead
- 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
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.string
instead
- val tab: Parsley[Char]
Parses a tab character ('\t').
Parses a tab character ('\t'). Returns a tab character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.tab
instead
- val upper: Parsley[Char]
Parses an upper case letter.
Parses an upper case letter. Returns the parsed character.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.upper
instead
- 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.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.whitespace
instead
- val whitespaces: Parsley[Unit]
Skips zero or more whitespace characters.
Skips zero or more whitespace characters. See also
skipMany
. Uses whitespace.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This method will be removed in Parsley 3.0, use
parsley.character.whitespaces
instead
This is the documentation for Parsley.
Package structure
The parsley package contains the
Parsley
class, as well as theResult
,Success
, andFailure
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.expr
contains the following sub modules:parsley.expr.chain
contains combinators used in expression parsingparsley.expr.precedence
is a builder for expression parsers built on a precedence table.parsley.implicits
contains several implicits to add syntactic sugar to the combinators, such as being able to use character and string literals directly as parsers, as well as enabling lifting of functions to work on parsers.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 theLexer
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.In addition to the modules and packages outlined above, this version of Parsley (up to version 3.0), also includes the so-called
old-style
API, which is deprecated (see the Parsley wiki for a discussion of these differences). You should use the modules described above, and avoid the following:parsley.BitGen
parsley.Char
parsley.CharSet
parsley.Combinator
parsley.ExpressionParser
parsley.Impl
parsley.Implicits
parsley.LanguageDef
parsley.NotRequired
parsley.Parser
parsley.Predicate
parsley.Reg
parsley.TokenParser