scala.util.parsing.combinator.lexical

Scanners

trait Scanners extends Parsers

This component provides core functionality for lexical parsers.

See its subclasses {@see Lexical} and -- most interestingly {@see StdLexical}, for more functionality.

known subclasses: Lexical

Inherits

  1. Parsers
  2. AnyRef
  3. Any

Type Members

  1. type Elem = Char

    the type of input elements

  2. class Error(msg: String, next: Reader[Elem]) extends NoSuccess with Product

    The fatal failure case of ParseResult: contains an error-message and the remaining input

  3. class Failure(msg: String, next: Reader[Elem]) extends NoSuccess with Product

    The failure case of ParseResult: contains an error-message and the remaining input

  4. type Input = Reader[Char]

    The parser input is an abstract reader of input elements

  5. class NoSuccess extends ParseResult[Nothing]

    A common super-class for unsuccessful parse results

  6. trait OnceParser[+T] extends Parser[T]

    A parser whose ~ combinator disallows back-tracking

  7. class ParseResult[+T] extends AnyRef

    A base class for parser results

  8. class Parser[+T] extends (Reader[Elem]) ⇒ ParseResult[T]

    The root class of parsers

  9. class Scanner extends Reader[Token]

    Scanner is essentially(*) a parser that produces Token's from a stream of characters

  10. class Success[+T](result: T, next: Reader[Elem]) extends ParseResult[T] with Product

    The success case of ParseResult: contains the result and the remaining input

  11. type Token

  12. class ~[+a, +b](_1: a, _2: b) extends Product

Value Members

  1. object NoSuccess extends AnyRef

    An extractor so NoSuccess(msg, next) can be used in matches

  2. def OnceParser[T](f: (Reader[Char]) ⇒ ParseResult[T]): Parser[T] with OnceParser[T]

  3. def Parser[T](f: (Reader[Char]) ⇒ ParseResult[T]): Parser[T]

  4. def accept[U](expected: String, f: PartialFunction[Char, U]): Parser[U]

    The parser that matches an element in the domain of the partial function f' If f' is defined on the first element in the input, f' is applied to it to produce this parser's result

  5. def accept[ES](es: ES)(arg0: (ES) ⇒ List[Char]): Parser[List[Char]]

    A parser that matches only the given list of element es' accept(es) succeeds if the input subsequently provides the elements in the list es'

  6. def accept(e: Char): Parser[Char]

    A parser that matches only the given element e' The method is implicit so that elements can automatically be lifted to their parsers

  7. def acceptIf(p: (Char) ⇒ Boolean)(err: (Char) ⇒ String): Parser[Char]

  8. def acceptMatch[U](expected: String, f: PartialFunction[Char, U]): Parser[U]

  9. def acceptSeq[ES](es: ES)(arg0: (ES) ⇒ Iterable[Char]): Parser[List[Char]]

  10. def chainl1[T, U](first: ⇒ Parser[T], p: ⇒ Parser[U], q: ⇒ Parser[(T, U) ⇒ T]): Parser[T]

    A parser generator that, roughly, generalises the rep1sep generator so that q', which parses the separator, produces a left-associative function that combines the elements it separates

  11. def chainl1[T](p: ⇒ Parser[T], q: ⇒ Parser[(T, T) ⇒ T]): Parser[T]

    A parser generator that, roughly, generalises the rep1sep generator so that q', which parses the separator, produces a left-associative function that combines the elements it separates

  12. def chainr1[T, U](p: ⇒ Parser[T], q: ⇒ Parser[(T, U) ⇒ U], combine: (T, U) ⇒ U, first: U): Parser[U]

    A parser generator that generalises the rep1sep generator so that q', which parses the separator, produces a right-associative function that combines the elements it separates

  13. def commit[T](p: ⇒ Parser[T]): Parser[T]

    Wrap a parser so that its failures become errors (the | combinator will give up as soon as it encounters an error, on failure it simply tries the next alternative)

  14. def elem(e: Char): Parser[Char]

    A parser that matches only the given element e' elem(e) succeeds if the input starts with an element e'

  15. def elem(kind: String, p: (Char) ⇒ Boolean): Parser[Char]

    A parser matching input elements that satisfy a given predicate

  16. def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

  17. def err(msg: String): Parser[Nothing]

    A parser that results in an error

  18. def errorToken(msg: String): Token

    This token is produced by a scanner {@see Scanner} when scanning failed

  19. def failure(msg: String): Parser[Nothing]

    A parser that always fails

  20. def guard[T](p: ⇒ Parser[T]): Parser[T]

    A parser generator for guard expressions

  21. def hashCode(): Int

    Returns a hash code value for the object

  22. var lastNoSuccess: NoSuccess

  23. def log[T](p: ⇒ Parser[T])(name: String): Parser[T]

  24. def mkList[T]: (~[T, List[T]]) ⇒ List[T]

  25. def not[T](p: ⇒ Parser[T]): Parser[Unit]

    Wrap a parser so that its failures&errors become success and vice versa -- it never consumes any input

  26. def opt[T](p: ⇒ Parser[T]): Parser[Option[T]]

    A parser generator for optional sub-phrases

  27. def phrase[T](p: Parser[T]): Parser[T]

    A parser generator delimiting whole phrases (i

  28. def positioned[T <: Positional](p: ⇒ Parser[T]): Parser[T]

    positioned' decorates a parser's result with the start position of the input it consumed

  29. def rep[T](p: ⇒ Parser[T]): Parser[List[T]]

    A parser generator for repetitions

  30. def rep1[T](first: ⇒ Parser[T], p: ⇒ Parser[T]): Parser[List[T]]

    A parser generator for non-empty repetitions

  31. def rep1[T](p: ⇒ Parser[T]): Parser[List[T]]

    A parser generator for non-empty repetitions

  32. def rep1sep[T](p: ⇒ Parser[T], q: ⇒ Parser[Any]): Parser[List[T]]

    A parser generator for non-empty repetitions

  33. def repN[T](n: Int, p: ⇒ Parser[T]): Parser[List[T]]

    A parser generator for a specified number of repetitions

  34. def repsep[T](p: ⇒ Parser[T], q: ⇒ Parser[Any]): Parser[List[T]]

    A parser generator for interleaved repetitions

  35. def success[T](v: T): Parser[T]

    A parser that always succeeds

  36. def toString(): String

    Returns a string representation of the object

  37. def token: Parser[Token]

    a parser that produces a token (from a stream of characters)

  38. def whitespace: Parser[Any]

    a parser for white-space -- its result will be discarded