The position information maintained by Lexer.

Constructor

new (source:String, min:Int, max:Int)

Creates a new Position from the given information.

Variables

pmax:Int

The last character position, counting from the beginning of the input.

pmin:Int

The first character position, counting from the beginning of the input.

psource:String

Name of the source.

Methods

format (input:ByteData):String

Formats this position by resolving line numbers within input.

If input is null, the result is unspecified.

getLinePosition (input:ByteData):{posMin:Int, posMax:Int, lineMin:Int, lineMax:Int}

toString ():String

Returns a readable representation of this position;

Static methods

staticunion (p1:Position, p2:Position):Position

Unifies two positions p1 and p2, using the minimum pmin and maximum pmax of both.

The resulting psource and pline are taken from p1.

If p1 or p2 are null, the result is unspecified.