public class JavaCharStream extends AbstractCharStream
| Modifier and Type | Field and Description |
|---|---|
protected static int |
NEXTCHAR_BUF_SIZE
Predefined buffer size
|
available, buffer, bufpos, bufsize, DEFAULT_BUF_SIZE, inBuf, maxNextCharInd, tokenBegin| Constructor and Description |
|---|
JavaCharStream(Provider dstream)
Constructor.
|
JavaCharStream(Provider dstream,
int startline,
int startcolumn)
Constructor.
|
JavaCharStream(Provider dstream,
int startline,
int startcolumn,
int buffersize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
char |
beginToken() |
void |
done()
The lexer calls this function to indicate that it is done with the stream
and hence implementations can free any resources held by this class.
|
protected void |
fillBuff() |
char |
readChar()
Get the next character from the selected input.
|
void |
reInit(Provider dstream)
Reinitialise.
|
void |
reInit(Provider dstream,
int startline,
int startcolumn)
Reinitialise.
|
void |
reInit(Provider dstream,
int startline,
int startcolumn,
int buffersize)
Reinitialise.
|
protected void |
streamClose()
Close the underlying stream.
|
protected int |
streamRead(char[] buffer,
int offset,
int len)
Read from the underlying stream.
|
adjustBeginLineColumn, backup, expandBuff, getBeginColumn, getBeginLine, getBufSizeAfterExpansion, getColumn, getEndColumn, getEndLine, getImage, getLine, getSuffix, getTabSize, internalAdjustBuffSize, internalSetBufLineColumn, internalUpdateLineColumn, isTrackLineColumn, reInit, setTabSize, setTrackLineColumnprotected static final int NEXTCHAR_BUF_SIZE
public JavaCharStream(Provider dstream, int startline, int startcolumn, int buffersize)
public JavaCharStream(Provider dstream, int startline, int startcolumn)
public JavaCharStream(Provider dstream)
protected int streamRead(char[] buffer,
int offset,
int len)
throws IOException
AbstractCharStreamstreamRead in class AbstractCharStreambuffer - the buffer to be filledoffset - The offset into the buffer. 0-basedlen - Number of chars to read.IOExceptionprotected void streamClose()
throws IOException
AbstractCharStreamstreamClose in class AbstractCharStreamIOException - If closing fails.protected void fillBuff()
throws IOException
fillBuff in class AbstractCharStreamIOExceptionpublic char beginToken()
throws IOException
beginToken in interface CharStreambeginToken in class AbstractCharStreamIOExceptionpublic char readChar()
throws IOException
CharStreamreadChar in interface CharStreamreadChar in class AbstractCharStreamIOException - on IO errorpublic void reInit(Provider dstream)
public void reInit(Provider dstream, int startline, int startcolumn)
public void reInit(Provider dstream, int startline, int startcolumn, int buffersize)
public void done()
CharStreamdone in interface CharStreamdone in class AbstractCharStreamCopyright © 2017–2022 Philip Helger. All rights reserved.