Packages

c

gnieh.string

StringScanner

class StringScanner extends AnyRef

A string scanner, modeled after the ruby StringScanner class.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StringScanner
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StringScanner(_source: String)

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. def append(str: String): Unit

    Appends the given string to the current source.

    Appends the given string to the current source. It does not affect the pointer.

  5. def apply(i: Int): Option[String]

    Returns the i-th captured group of the last match if any.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def bol(): Boolean

    Indicates whether the current pointer is at the beginning of a line.

  8. def check(re: Regex): Option[String]

    Returns the same result as scan would return without advancing the pointer.

    Returns the same result as scan would return without advancing the pointer. The lastMatched however is updated.

  9. def checkUntil(re: Regex): Option[String]

    Returns the same result as scanUntil would return without advancing the pointer.

    Returns the same result as scanUntil would return without advancing the pointer. The lastMatched however is updated.

  10. def checkUntilExclusive(re: Regex): String

    Returns the same result as scanUntilExclusive would return without advancing the pointer.

    Returns the same result as scanUntilExclusive would return without advancing the pointer. The lastMatched however is updated.

  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def eos(): Boolean

    Indicates whether the current pointer is at the end of the source string.

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def get(): Option[Char]

    Returns the next character, or None if EOS was reached.

  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def lastMatched: Option[Match]

    Returns the last matched string if any, or None otherwise.

  21. def matches(re: Regex): Boolean

    Checks that the string amtches the regular expression at the current pointer.

    Checks that the string amtches the regular expression at the current pointer. Neither the lastMatched nor the pointer are updated.

  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  25. def peek(length: Int): String

    Extracts the string starting at the current pointer of the given length.

    Extracts the string starting at the current pointer of the given length. If fewer characters are left in the string, then the maximum possible number of characters is returned.

  26. def pointer: Int

    Returns the current pointer in the scanner.

  27. def pointer_=(pos: Int): Unit

    Sets the current pointer at the given position.

    Sets the current pointer at the given position. Reset the lastMatched data.

  28. def reset(): Unit

    Reset the pointer (at position 0) and clears the last match.

  29. def rest(): String

    Returns the (possibly empty) rest string starting at the current pointer.

  30. def scan(re: Regex): Option[String]

    Tries to match the given regular expression and returns the matched result, advancing the _pointer by the size of the matching substring.

    Tries to match the given regular expression and returns the matched result, advancing the _pointer by the size of the matching substring. If it did not match, the pointer is left unchanged, and None is returned.

  31. def scanUntil(re: Regex): Option[String]

    Scans the string until the pattern is matched and consumed.

    Scans the string until the pattern is matched and consumed. Returns the substring up to and including the end of the match, advancing the pointer by the size of the matching substring. If it did not match, the pointer is left unchanged, and None is returned.

  32. def scanUntilExclusive(re: Regex): String

    Scans the string until the pattern is matched but not consumed.

    Scans the string until the pattern is matched but not consumed. Returns the substring up to and excluding the start of the match, advancing the pointer by the size of the matching substring. If it did not match, the pointer is left unchanged, and None is returned.

  33. def skip(re: Regex): Int

    Tries to skip the given regular expression starting at the current _pointer.

    Tries to skip the given regular expression starting at the current _pointer. Advances the pointer by the size of the matching string, and returns this size. If it did not match, 0 is returned and the pointer is not advanced.

  34. def skipUntil(re: Regex): Int

    Advances the pointer until pattern is matched and consumed.

    Advances the pointer until pattern is matched and consumed. Returns the size of consumed string.

  35. def skipUntilExclusive(re: Regex): Int

    Advances the pointer until pattern is matched but not consumed.

    Advances the pointer until pattern is matched but not consumed. Returns the size of consumed string.

  36. def source: String

    Returns the string being scanned

  37. def source_=(str: String): Unit

    Sets the string to scan and reset this scanner.

  38. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  39. def terminate(): Unit

    Set the pointer at the end of the input and clears the last match.

  40. def toString(): String
    Definition Classes
    AnyRef → Any
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped