public abstract class InputPosition extends Object implements Location
| Constructor and Description |
|---|
InputPosition() |
| Modifier and Type | Method and Description |
|---|---|
static InputPosition |
advance(InputPosition curPos,
char pastChar)
Returns a position one character past the given.
|
static InputPosition |
advance(InputPosition curPos,
int offset,
String stringToPass) |
abstract int |
compareTo(Location ref) |
static InputPosition |
copy(InputPosition i) |
static Pair<Integer,Integer> |
countNewlines(String lexeme) |
abstract int |
diff(InputPosition ref)
Calculates the offset from one position to another.
|
abstract boolean |
equals(Object rhs) |
static InputPosition |
fromSAXLocator(InputPosition pos,
Locator locator)
Builds a position based on information from a
Locator object. |
abstract int |
getColumn()
The column the parser has reached.
|
abstract String |
getFileName()
The name of the file being parsed.
|
abstract int |
getLine()
The line the parser has reached.
|
abstract long |
getPos()
The position in the file (makes sense only for real locations -- virtual locations should return a dummy value).
|
abstract int |
hashCode() |
static InputPosition |
initialPos()
Returns a reference position for the "initial" point in a stream.
|
static InputPosition |
initialPos(String fileName)
Returns a reference position for the "initial" point in a file stream.
|
abstract boolean |
isAfter(InputPosition rhs)
Tests whether this position is after another.
|
abstract boolean |
isBefore(InputPosition rhs)
Tests whether this position is before another.
|
public abstract boolean isBefore(InputPosition rhs)
rhs - The position against which to test.true iff this falls before rhs.public abstract boolean isAfter(InputPosition rhs)
rhs - The position against which to test.true iff this falls after rhs.public abstract int diff(InputPosition ref)
ref - The reference position.ref.public abstract int compareTo(Location ref)
compareTo in interface Comparable<Location>public abstract String getFileName()
LocationgetFileName in interface Locationpublic abstract int getLine()
Locationpublic abstract int getColumn()
Locationpublic abstract long getPos()
Locationpublic static InputPosition initialPos()
public static InputPosition initialPos(String fileName)
fileName - The name of the file.public static InputPosition fromSAXLocator(InputPosition pos, Locator locator)
Locator object.pos - An input position at the beginning of the file being parsed.locator - A locator passed from the SAX parser to indicate where the parser is located.public static InputPosition copy(InputPosition i)
public static InputPosition advance(InputPosition curPos, char pastChar)
curPos - A reference position.pastChar - The character that will be passed.curPos.public static InputPosition advance(InputPosition curPos, int offset, String stringToPass)
Copyright © 2018 Minnesota Extensible Language Tools. All rights reserved.