scala.util.parsing.input
package scala.util.parsing.input
Type members
Classlikes
A character array reader reads a stream of characters (keeping track of their positions)
from an array.
from an array.
- Value Params
- chars
-
an array of characters
- index
-
starting offset into the array; the first element returned will be
source(index)
- Companion
- object
A character array reader reads a stream of characters (keeping track of their positions)
from an array.
from an array.
- Value Params
- offset
-
starting offset.
- source
-
the source sequence
- Companion
- object
OffsetPosition
is a standard class for positionsrepresented as offsets into a source
document
.- Value Params
- offset
-
The offset indicating the position
- source
-
The source document
- Companion
- object
object OffsetPosition extends AbstractFunction2[CharSequence, Int, OffsetPosition] with PositionCache
An object holding the index cache.
- Companion
- class
object PagedSeq
The
a random access sequence.
PagedSeq
object defines a lazy implementations ofa random access sequence.
Provides utility methods that return instances of
PagedSeq[Char]
.fromIterator
and fromIterable
provide generalised instances of PagedSeq
- Companion
- class
An implementation of lazily computed sequences, where elements are stored
in "pages", i.e. arrays of fixed size.
in "pages", i.e. arrays of fixed size.
A paged sequence is constructed from a function that produces more elements when asked.
The producer function -
The
It should try to fill the array between start and end indices (excluding end index).
It returns the number of elements produced, or -1 if end of logical input stream was reached
before reading any element.
The producer function -
more
, is similar to the read method in java.io.Reader.The
more
function takes three parameters: an array of elements, a start index, and an end index.It should try to fill the array between start and end indices (excluding end index).
It returns the number of elements produced, or -1 if end of logical input stream was reached
before reading any element.
- Type Params
- T
-
the type of the elements contained in this paged sequence, with an
ClassTag
context bound.
- Companion
- object
A character array reader reads a stream of characters (keeping track of their positions)
from an array.
from an array.
- Value Params
- offset
-
starting offset.
- seq
-
the source sequence
- Companion
- object
trait Position
Position
is the base trait for objects describing a position in a document
.It provides functionality for:
- generating a visual representation of this position (
- comparing two positions (
- generating a visual representation of this position (
longString
);- comparing two positions (
<
).To use this class for a concrete kind of
document
, implement the lineContents
method.A StreamReader reads from a character sequence, typically created as a PagedSeq
from a java.io.Reader
from a java.io.Reader
NOTE:
StreamReaders do not really fulfill the new contract for readers, which
requires a
Instead source is treated line by line.
As a consequence, regex matching cannot extend beyond a single line
when a StreamReader are used for input.
StreamReaders do not really fulfill the new contract for readers, which
requires a
source
CharSequence representing the full input.Instead source is treated line by line.
As a consequence, regex matching cannot extend beyond a single line
when a StreamReader are used for input.
If you need to match regexes spanning several lines you should consider
class
class
PagedSeqReader
instead.- Companion
- object