| java.lang.Object fri.patterns.interpreter.parsergenerator.lexer.Input
All known Subclasses: fri.patterns.interpreter.parsergenerator.lexer.InputText,
Input | class Input (Code) | | Lexer input wrapper. The input can be InputStream, Reader, File, String or StringBuffer.
If Input is InputStream, no Reader will be used, which means that the input reads bytes
and not characters.
The read() methode returns EOF (-1) when there is no more input.
author: (c) 2002, Fritz Ritzberger |
Field Summary | |
final public static int | EOF |
Method Summary | |
protected int | convertInput(int i) Override this to buffer lines or convert any read int. | public int | getMark() Get the current read mark and turn on buffering. | public int | getReadOffset() Returns the offset of the last read char/byte (bigger or equal to scan offset). | public int | getScanOffset() Returns the offset of the last scanned char/byte, less or equal the read offset. | public int[] | getUnreadBuffer() Returns the part of the buffer that was not yet consumed. | protected int | getUnreadLength() Returns the length that was not yet consumed. | public int | peek() Read a lookahead character and reset mark after. | public int | read() Returns next character or byte from input. | public void | resolveBuffer() Resolve buffer, skip rest of unread int's to buffer start. | public void | setMark(int mark) Set read position to passed mark. |
EOF | final public static int EOF(Code) | | |
convertInput | protected int convertInput(int i)(Code) | | Override this to buffer lines or convert any read int.
|
getMark | public int getMark()(Code) | | Get the current read mark and turn on buffering. The mark is a relative offset, not an absolute read position.
|
getReadOffset | public int getReadOffset()(Code) | | Returns the offset of the last read char/byte (bigger or equal to scan offset).
|
getScanOffset | public int getScanOffset()(Code) | | Returns the offset of the last scanned char/byte, less or equal the read offset.
|
getUnreadBuffer | public int[] getUnreadBuffer()(Code) | | Returns the part of the buffer that was not yet consumed.
|
getUnreadLength | protected int getUnreadLength()(Code) | | Returns the length that was not yet consumed.
|
peek | public int peek() throws IOException(Code) | | Read a lookahead character and reset mark after.
|
read | public int read() throws IOException(Code) | | Returns next character or byte from input. Closes input when EOF is reached.
|
resolveBuffer | public void resolveBuffer()(Code) | | Resolve buffer, skip rest of unread int's to buffer start.
|
setMark | public void setMark(int mark)(Code) | | Set read position to passed mark. Needed when trying more scan items. This does not turn on buffering like getMark()!
|
|
|