scala.util.parsing.input

Members list

Type members

Classlikes

An object encapsulating basic character constants.

An object encapsulating basic character constants.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class CharArrayReader(chars: Array[Char], index: Int) extends CharSequenceReader

A character array reader reads a stream of characters (keeping track of their positions) from an array.

A character array reader reads a stream of characters (keeping track of their positions) from an array.

Value parameters

chars

an array of characters

index

starting offset into the array; the first element returned will be source(index)

Attributes

Companion
object
Supertypes
class Reader[Char]
class Object
trait Matchable
class Any

An object encapsulating basic character constants.

An object encapsulating basic character constants.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class CharSequenceReader(val source: CharSequence, val offset: Int) extends Reader[Char]

A character array reader reads a stream of characters (keeping track of their positions) from an array.

A character array reader reads a stream of characters (keeping track of their positions) from an array.

Value parameters

offset

starting offset.

source

the source sequence

Attributes

Companion
object
Supertypes
class Reader[Char]
class Object
trait Matchable
class Any
Known subtypes
object NoPosition extends Position

Undefined position.

Undefined position.

Attributes

Supertypes
trait Position
class Object
trait Matchable
class Any
Self type
NoPosition.type
case class OffsetPosition(source: CharSequence, offset: Int) extends Position

OffsetPosition is a standard class for positions represented as offsets into a source document.

OffsetPosition is a standard class for positions represented as offsets into a source document.

Value parameters

offset

The offset indicating the position

source

The source document

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Position
class Object
trait Matchable
class Any
Show all
object OffsetPosition extends AbstractFunction2[CharSequence, Int, OffsetPosition]

An object holding the index cache.

An object holding the index cache.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class AbstractFunction2[CharSequence, Int, OffsetPosition]
trait (CharSequence, Int) => OffsetPosition
class Object
trait Matchable
class Any
Show all
Self type
object PagedSeq

The PagedSeq object defines a lazy implementations of a random access sequence.

The PagedSeq object defines a lazy implementations of a random access sequence.

Provides utility methods that return instances of PagedSeq[Char]. fromIterator and fromIterable provide generalised instances of PagedSeq

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
PagedSeq.type
class PagedSeq[T] extends AbstractSeq[T], IndexedSeq[T]

An implementation of lazily computed sequences, where elements are stored in "pages", i.e. arrays of fixed size.

An implementation of lazily computed sequences, where elements are stored 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 - 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 parameters

T

the type of the elements contained in this paged sequence, with an ClassTag context bound.

Attributes

Companion
object
Supertypes
trait IndexedSeq[T]
class AbstractSeq[T]
trait Seq[T]
trait Equals
trait SeqOps[T, IndexedSeq, IndexedSeq[T]]
trait PartialFunction[Int, T]
trait Int => T
class AbstractIterable[T]
trait Iterable[T]
trait IterableOnce[T]
class Object
trait Matchable
class Any
Show all

An object encapsulating basic character constants.

An object encapsulating basic character constants.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class PagedSeqReader(seq: PagedSeq[Char], val offset: Int) extends Reader[Char]

A character array reader reads a stream of characters (keeping track of their positions) from an array.

A character array reader reads a stream of characters (keeping track of their positions) from an array.

Value parameters

offset

starting offset.

seq

the source sequence

Attributes

Companion
object
Supertypes
class Reader[Char]
class Object
trait Matchable
class Any
Known subtypes
class StreamReader
Self type
trait Position

Position is the base trait for objects describing a position in a document.

Position is the base trait for objects describing a position in a document.

It provides functionality for:

  • 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.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object NoPosition
trait Positional

A trait for objects that have a source position.

A trait for objects that have a source position.

Attributes

Supertypes
class Object
trait Matchable
class Any
abstract class Reader[+T]

An interface for streams of values that have positions.

An interface for streams of values that have positions.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Scanner
class PackratReader[T]
class StreamReader
Show all
object StreamReader

An object to create a StreamReader from a java.io.Reader.

An object to create a StreamReader from a java.io.Reader.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
sealed class StreamReader extends PagedSeqReader

A StreamReader reads from a character sequence, typically created as a PagedSeq from a java.io.Reader

A StreamReader reads from a character sequence, typically created as a PagedSeq from a java.io.Reader

NOTE: 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 PagedSeqReader instead.

Attributes

Companion
object
Supertypes
class Reader[Char]
class Object
trait Matchable
class Any