scala.util.parsing.combinator.syntactical

StdTokenParsers

trait StdTokenParsers extends TokenParsers

This component provides primitive parsers for the standard tokens defined in StdTokens'.

known subclasses: StandardTokenParsers, Parser

Inherits

  1. TokenParsers
  2. Parsers
  3. AnyRef
  4. Any

Type Members

  1. type Elem = Token

    The input-type for these parsers

  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[Token]

    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 Success[+T](result: T, next: Reader[Elem]) extends ParseResult[T] with Product

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

  10. type Tokens <: StdTokens

    Tokens is the abstract type of the Token's consumed by the parsers in this component

  11. 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[Token]) ⇒ ParseResult[T]): Parser[T] with OnceParser[T]

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

  4. def accept[U](expected: String, f: PartialFunction[Token, 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[Token]): Parser[List[Token]]

    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: Token): Parser[Token]

    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: (Token) ⇒ Boolean)(err: (Token) ⇒ String): Parser[Token]

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

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

  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: Token): Parser[Token]

    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: (Token) ⇒ Boolean): Parser[Token]

    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 failure(msg: String): Parser[Nothing]

    A parser that always fails

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

    A parser generator for guard expressions

  20. def hashCode(): Int

    Returns a hash code value for the object

  21. def ident: Parser[String]

    A parser which matches an identifier

  22. def keyword(chars: String): Parser[String]

    A parser which matches a single keyword token

  23. var lastNoSuccess: NoSuccess

  24. val lexical: Tokens

    lexical is the component responsible for consuming some basic kind of input (usually character-based) and turning it into the tokens understood by these parsers

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

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

  27. 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

  28. def numericLit: Parser[String]

    A parser which matches a numeric literal

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

    A parser generator for optional sub-phrases

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

    A parser generator delimiting whole phrases (i

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

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

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

    A parser generator for repetitions

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

    A parser generator for non-empty repetitions

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

    A parser generator for non-empty repetitions

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

    A parser generator for non-empty repetitions

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

    A parser generator for a specified number of repetitions

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

    A parser generator for interleaved repetitions

  38. def stringLit: Parser[String]

    A parser which matches a string literal

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

    A parser that always succeeds

  40. def toString(): String

    Returns a string representation of the object