scala.util.parsing.combinator.Parsers

class UnitParser

[source: scala/util/parsing/combinator/Parsers.scala]

abstract class UnitParser
extends (Reader) => ParseResult[Unit]
The root class of special parsers returning the trivial result Unit These compose differently from normal parsers in that the Unit result in a sequential or function composition is dropped.
Direct Known Subclasses:
Parsers.UnitOnceParser

Method Summary
def ^^ [U](v : U) : Parser[U]
A parser combinator for function application

`p ^^ v' succeeds if `p' succeeds; it returns `v'.

abstract def apply (in : Reader) : ParseResult[Unit]
An unspecified method that defines the behaviour of this parser.
def | [Q](q : => Q)(implicit view$5 : (Q) => UnitParser) : UnitParser
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).

def ~ [A](q : => A)(implicit view$3 : (A) => UnitParser) : UnitParser
A parser combinator for sequential composition with a unit-parser

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

def ~ [U](q : => Parser[U]) : Parser[U]
A parser combinator for sequential composition

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

def ~! [Q](q : => Q)(implicit view$4 : (Q) => UnitParser) : UnitParser
A parser combinator for non-back-tracking sequential composition with a unit-parser

`p ~! q' succeeds if `p' succeeds and `q' succeeds on the input left over by `p'. In case of failure, no back-tracking is performed (in an earlier parser produced by the | combinator).

def ~! [U](q : => Parser[U]) : Parser[U]
A parser combinator for non-back-tracking sequential composition

`p ~! q' succeeds if `p' succeeds and `q' succeeds on the input left over by `p'. In case of failure, no back-tracking is performed (in an earlier parser produced by the | combinator).

Methods inherited from Function1
toString, compose, andThen
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def apply(in : Reader) : ParseResult[Unit]
An unspecified method that defines the behaviour of this parser.
Overrides
Function1.apply

def ~[U](q : => Parser[U]) : Parser[U]
A parser combinator for sequential composition

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

Parameters
q - a parser that will be executed after `p' (this parser) succeeds
Returns
a `Parser' that -- on success -- returns the result of `q'. The resulting parser fails if either `p' or `q' fails.

def ~[A](q : => A)(implicit view$3 : (A) => UnitParser) : UnitParser
A parser combinator for sequential composition with a unit-parser

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

Parameters
q - a parser (convertible to a UnitParser) that will be executed after `p' (this parser) succeeds
Returns
a `UnitParser' that fails if either `p' or `q' fails.

def ~![U](q : => Parser[U]) : Parser[U]
A parser combinator for non-back-tracking sequential composition

`p ~! q' succeeds if `p' succeeds and `q' succeeds on the input left over by `p'. In case of failure, no back-tracking is performed (in an earlier parser produced by the | combinator).

Parameters
q - a parser that will be executed after `p' (this parser) succeeds
Returns
a `Parser' that -- on success -- returns the result of `q`. The resulting parser fails if either `p' or `q' fails, this failure is fatal.

def ~![Q](q : => Q)(implicit view$4 : (Q) => UnitParser) : UnitParser
A parser combinator for non-back-tracking sequential composition with a unit-parser

`p ~! q' succeeds if `p' succeeds and `q' succeeds on the input left over by `p'. In case of failure, no back-tracking is performed (in an earlier parser produced by the | combinator).

Parameters
q - a parser that will be executed after `p' (this parser) succeeds
Returns
a `UnitParser' that fails if either `p' or `q' fails, this failure is fatal.

def |[Q](q : => Q)(implicit view$5 : (Q) => UnitParser) : UnitParser
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).

Parameters
q - a parser that will be executed if `p' (this parser) fails (and allows back-tracking)
Returns
a `Parser' succeeds if (and only if)
  • `p' succeeds, or
  • if `p' fails allowing back-tracking and `q' succeeds.

def ^^[U](v : U) : Parser[U]
A parser combinator for function application

`p ^^ v' succeeds if `p' succeeds; it returns `v'.

Parameters
v - a value that's used as the result of the returned Parser (if it was successful).
Returns
a parser that has the same behaviour as the current parser, but whose result is consists of `v'.