Class JavaCharStream
java.lang.Object
fr.mines_stetienne.ci.sparql_generate.lang.AbstractCharStream
fr.mines_stetienne.ci.sparql_generate.lang.JavaCharStream
- All Implemented Interfaces:
CharStream
An implementation of interface CharStream, where the stream is assumed to
contain only ASCII characters (with java-like unicode escape processing).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Readerprotected static final intPredefined buffer sizeprotected char[]protected intFields inherited from class fr.mines_stetienne.ci.sparql_generate.lang.AbstractCharStream
available, bufcolumn, buffer, BUFFER_INCREASE, bufline, bufpos, bufsize, column, DEFAULT_BUF_SIZE, inBuf, line, maxNextCharInd, prevCharIsCR, prevCharIsLF, tokenBegin -
Constructor Summary
ConstructorsConstructorDescriptionJavaCharStream(InputStream dstream, Charset encoding) Constructor.JavaCharStream(InputStream dstream, Charset encoding, int startline, int startcolumn) Constructor.JavaCharStream(InputStream dstream, Charset encoding, int startline, int startcolumn, int buffersize) Constructor.JavaCharStream(Reader dstream) Constructor.JavaCharStream(Reader dstream, int startline, int startcolumn) Constructor.JavaCharStream(Reader dstream, int startline, int startcolumn, int buffersize) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcharvoiddone()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 voidfillBuff()protected charreadByte()charreadChar()Read a character.voidreInit(InputStream dstream, Charset encoding) Reinitialise.voidreInit(InputStream dstream, Charset encoding, int startline, int startcolumn) Reinitialise.voidreInit(InputStream dstream, Charset encoding, int startline, int startcolumn, int buffersize) Reinitialise.voidReinitialise.voidReinitialise.voidReinitialise.protected voidprotected intstreamRead(char[] buffer, int offset, int len) Methods inherited from class fr.mines_stetienne.ci.sparql_generate.lang.AbstractCharStream
adjustBeginLineColumn, backup, expandBuff, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getSuffix, getTabSize, isTrackLineColumn, reInit, setTabSize, setTrackLineColumn, updateLineColumn
-
Field Details
-
NEXTCHAR_BUF_SIZE
protected static final int NEXTCHAR_BUF_SIZEPredefined buffer size- See Also:
-
nextCharBuf
protected char[] nextCharBuf -
nextCharInd
protected int nextCharInd -
inputStream
-
-
Constructor Details
-
JavaCharStream
Constructor. -
JavaCharStream
Constructor. -
JavaCharStream
Constructor. -
JavaCharStream
public JavaCharStream(InputStream dstream, Charset encoding, int startline, int startcolumn, int buffersize) Constructor. -
JavaCharStream
Constructor. -
JavaCharStream
Constructor.
-
-
Method Details
-
streamRead
- Specified by:
streamReadin classAbstractCharStream- Throws:
IOException
-
streamClose
- Specified by:
streamClosein classAbstractCharStream- Throws:
IOException
-
fillBuff
- Overrides:
fillBuffin classAbstractCharStream- Throws:
IOException
-
readByte
- Throws:
IOException
-
beginToken
- Specified by:
beginTokenin interfaceCharStream- Overrides:
beginTokenin classAbstractCharStream- Returns:
- starting character for token.
- Throws:
IOException
-
adjustBuffSize
protected void adjustBuffSize() -
readChar
Read a character.- Specified by:
readCharin interfaceCharStream- Overrides:
readCharin classAbstractCharStream- Returns:
- the next character from the selected input
- Throws:
IOException- on IO error
-
reInit
Reinitialise. -
reInit
Reinitialise. -
reInit
Reinitialise. -
reInit
Reinitialise. -
reInit
Reinitialise. -
reInit
public void reInit(InputStream dstream, Charset encoding, int startline, int startcolumn, int buffersize) Reinitialise. -
done
public void done()Description copied from interface:CharStreamThe lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class. Again, the body of this function can be just empty and it will not affect the lexer's operation.- Specified by:
donein interfaceCharStream- Overrides:
donein classAbstractCharStream
-