|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.inria.ns.reflex.util.Scanner
org.inria.ns.reflex.util.ReaderScanner
org.inria.ns.reflex.util.TrackableReaderScanner
public class TrackableReaderScanner
A scanner that tracks the current line and column.
Constructor Summary | |
---|---|
TrackableReaderScanner(Reader reader)
Create a new scanner. |
|
TrackableReaderScanner(Reader reader,
int line,
int column)
Create a new scanner with an initial position. |
Method Summary | |
---|---|
void |
cancel()
Cancel the current mark. |
void |
consume()
Consume the characters read so far. |
int |
getColumnNumber()
Return the current column number. |
int |
getLineNumber()
Return the current line number. |
void |
mark(int limit)
Mark the current position. |
void |
read()
Read a character. |
Methods inherited from class org.inria.ns.reflex.util.ReaderScanner |
---|
getRemainder, getRemainderString |
Methods inherited from class org.inria.ns.reflex.util.Scanner |
---|
getPosition, getSourceIndex, hasNext, hasNextChar, hasNextChar, hasNextString, lookAhead, nextChar, nextChar, nextNumber, nextNumber, nextObject, nextString, nextString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TrackableReaderScanner(Reader reader) throws IOException
reader
- The input to read.
IOException
- When an I/O error occur.public TrackableReaderScanner(Reader reader, int line, int column) throws IOException
reader
- The input to read.line
- The initial line number.column
- The initial column number.
IOException
- When an I/O error occur.Method Detail |
---|
public int getColumnNumber()
getColumnNumber
in interface Trackable
Trackable.getColumnNumber()
public int getLineNumber()
getLineNumber
in interface Trackable
Trackable.getLineNumber()
public void read() throws IOException
read
in class ReaderScanner
IOException
- When an I/O error occur.#hasNextChar(char)
,
Scanner.nextChar()
,
Scanner.lookAhead()
public void mark(int limit) throws IOException
mark
in class ReaderScanner
limit
- The max number of characters than can be buffered
IOException
- When an I/O error occur.Reader.mark(int)
public void cancel() throws IOException
cancel
in class ReaderScanner
IOException
- When an I/O error occur.ReaderScanner.mark(int)
public void consume() throws IOException
consume
in class ReaderScanner
IOException
- When an I/O error occur.ReaderScanner.mark(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |