Packages

c

laika.parse

RootSource

class RootSource extends SourceCursor

A root source represents the full input string of a parsing operation.

In a single-pass parser like those for HOCON or CSS, only RootCursor instances will be used for the entire parsing operation.

In a multi-pass parser like those for text markup, a RootCursor is only used for the first pass, whereas the subsequent passes on parts of the input are performed with the other SourceCursor implementations.

For this reason this type of cursor is only meant to be used for creating a root cursor for the input holding the whole document (e.g. the entire markup document or the full template).

For creating a cursor for a fragment of the input, either BlockSource or LineSource must be used to preserve position tracking in relation to the root input.

Linear Supertypes
SourceCursor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RootSource
  2. SourceCursor
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RootSource(inputRef: InputString, offset: Int, nestLevel: Int)

Type Members

  1. type Self = RootSource
    Definition Classes
    RootSourceSourceCursor

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def atEnd: Boolean

    Indicates whether this contexts offset is behind the last character of the input string

    Indicates whether this contexts offset is behind the last character of the input string

    Definition Classes
    RootSourceSourceCursor
  6. def canConsume(maxChars: Int): Int
    Attributes
    protected
    Definition Classes
    SourceCursor
  7. def capture(numChars: Int): String

    Captures a string containing the specified number of characters from the current offset.

    Captures a string containing the specified number of characters from the current offset. If the number of remaining characters is less than the specified number, all remaining characters will be returned.

    Definition Classes
    RootSourceSourceCursor
  8. def char: Char

    The character at the current offset.

    The character at the current offset.

    Definition Classes
    SourceCursor
  9. def charAt(relativeOffset: Int): Char

    The character at the specified offset, relative from the current offset.

    The character at the specified offset, relative from the current offset.

    Definition Classes
    SourceCursor
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  11. def consume(numChars: Int): RootSource

    Consumes the specified number of characters, returning a new SourceCursor with the new offset.

    Consumes the specified number of characters, returning a new SourceCursor with the new offset.

    Definition Classes
    RootSourceSourceCursor
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(obj: Any): Boolean
    Definition Classes
    RootSource → AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    RootSource → AnyRef → Any
  17. val input: String

    The full input string, containing the string portions before and after the current offset.

    The full input string, containing the string portions before and after the current offset.

    Definition Classes
    RootSourceSourceCursor
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def length: Int

    The length of the input of this cursor.

    The length of the input of this cursor.

    Definition Classes
    SourceCursor
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. val nestLevel: Int

    The nest level of this cursor in case of recursive parsing.

    The nest level of this cursor in case of recursive parsing.

    Definition Classes
    RootSourceSourceCursor
  22. def nextNestLevel: RootSource

    Create a new instance of this cursor with the nestLevel incremented.

    Create a new instance of this cursor with the nestLevel incremented.

    Definition Classes
    RootSourceSourceCursor
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. val offset: Int

    The offset of this cursor from the start of the source.

    The offset of this cursor from the start of the source.

    Definition Classes
    RootSourceSourceCursor
  26. val path: Option[Path]

    The (virtual) path of the document this input originates from; may be empty in case of generated sources.

    The (virtual) path of the document this input originates from; may be empty in case of generated sources.

    Definition Classes
    RootSourceSourceCursor
  27. lazy val position: Position

    The current position in the input string.

    The current position in the input string.

    Definition Classes
    RootSourceSourceCursor
  28. def remaining: Int

    Indicates the number of characters remaining in the input string after the current offset.

    Indicates the number of characters remaining in the input string after the current offset.

    Definition Classes
    RootSourceSourceCursor
  29. def reverse: RootSource

    Returns a new SourceCursor with the input string being reversed, but pointing to the same character as this context.

    Returns a new SourceCursor with the input string being reversed, but pointing to the same character as this context.

    This is a low-level optimization for parsers that look for strings like email addresses where the first character is not significant, so that parsing backwards from any @ encountered in the input provided better performance.

    Definition Classes
    RootSourceSourceCursor
  30. val root: RootSource

    The source for the root input, positioned to match the offset of this (potentially nested) source.

    The source for the root input, positioned to match the offset of this (potentially nested) source.

    Definition Classes
    RootSourceSourceCursor
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    RootSource → AnyRef → Any
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from SourceCursor

Inherited from AnyRef

Inherited from Any

Ungrouped