scala.util.parsing.combinatorold.lexical

trait Scanners

[source: scala/util/parsing/combinatorold/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
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, commit, not, elem, elem, accept, accept, accept, failure, fail, success, success, discard, log, log, rep, rep, repsep, rep1, rep1, repN, rep1, repN, rep1sep, rep1sep, chainl1, chainl1, chainr1, opt, opt, positioned, positioned
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]
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