scala.util.parsing.combinator1.lexical

trait Scanners

[source: scala/util/parsing/combinator1/lexical/Scanners.scala]

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.

@requires token a parser that produces a token (from a stream of characters) @requires whitespace a unit-parser for white-space @provides Scanner essentially a parser that parses a stream of characters to produce `Token's, which are typically passed to a syntactical parser (which operates on `Token's, not on individual characters).
Author
Martin Odersky, Adriaan Moors
Direct Known Subclasses:
Lexical

Type Summary
type Elem
the type of input elements
abstract type Token
Values and Variables inherited from Parsers
lastNoSuccess
Method Summary
abstract def errorToken (msg : java.lang.String) : Token
This token is produced by a scanner {@see Scanner} when scanning failed.
abstract def token : Parser[Token]
a parser that produces a token (from a stream of characters)
abstract def whitespace : Parser[Any]
a parser for white-space -- its result will be discarded
Methods inherited from Parsers
commit, elem, elem, accept, accept, accept, failure, err, success, log, rep, repsep, rep1, rep1, repN, rep1sep, chainl1, chainl1, chainr1, opt, positioned, const
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
class Scanner (in : Reader[Char]) extends Reader[Token]

Scanner is essentially(*) a parser that produces `Token's from a stream of characters. The tokens it produces are typically passed to parsers in TokenParsers.

Note: (*) Scanner is really a `Reader' of `Token's

Type Details
type Elem
the type of input elements

abstract type Token

Method Details
abstract def errorToken(msg : java.lang.String) : Token
This token is produced by a scanner {@see Scanner} when scanning failed.

abstract def token : Parser[Token]
a parser that produces a token (from a stream of characters)

abstract def whitespace : Parser[Any]
a parser for white-space -- its result will be discarded