IteratorStream
places a simple stream on top of an iterator,
returning Option
-wrapped instances from the underlying iterator.
IteratorStream
places a simple stream on top of an iterator,
returning Option
-wrapped instances from the underlying iterator.
When the stream is exhausted, the Iterator
stream returns
None
. Differences from a plain Iterator
include:
- An IteratorStream
will not throw an exception if you try to read
past the end of it. Instead, it will just keep returning None
.
Example of use with a string:
import grizzled.parsing.IteratorStream val s = ... val istream = new IteratorStream[Char](s.elements)
The Pushback
trait can be mixed into an IteratorStream
to permit arbitrary pushback.
A simple string token class, consisting of:
A simple string token class, consisting of:
- a string token - the starting position of the token in the original string from which the token was parsed
Methods and classes useful for parsing various things.