scala.util.parsing.input

trait Position

[source: scala/util/parsing/input/Position.scala]

trait Position
extends AnyRef

Position is the base class for objects describing a position in a ``document''.

It provides functionality for:

To use this class for a concrete kind of ``document'', implement the lineContents method.

Author
Martin Odersky, Adriaan Moors
Direct Known Subclasses:
CharArrayPosition, NoPosition

Method Summary
def < (that : Position) : Boolean
Compare this position to another, by first comparing their line numbers, and then -- if necessary -- using the columns to break a tie.
abstract def column : Int
The column number referred to by the position; column numbers start at 1
abstract def line : Int
The line number referred to by the position; line numbers start at 1
protected abstract def lineContents (lnum : Int) : String
The contents of the line numbered `lnum' (must not contain a new-line character).
def longString : String
Returns a more ``visual'' representation of this position. More precisely, the resulting string consists of two lines:
  1. the line in the document referred to by this position
  2. a caret indicating the column
Example:
    List(this, is, a, line, from, the, document)
                    ^
override def toString : String
Returns a string representation of the `Position', of the form `line.column'
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf