Scala Library
|
|
trait
Scanners
extends
ParsersThis 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).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
() 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 .
|
Type Details |
Method Details |
abstract
def
errorToken(msg : java.lang.String) : Token
Scala Library
|
|