public class JavaCharStream
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
bufcolumn |
protected char[] |
buffer |
protected int[] |
bufline |
int |
bufpos |
protected int |
column |
protected int |
inBuf |
protected java.io.Reader |
inputStream |
protected int |
line |
protected int |
maxNextCharInd |
protected char[] |
nextCharBuf |
protected int |
nextCharInd |
protected boolean |
prevCharIsCR |
protected boolean |
prevCharIsLF |
static boolean |
staticFlag
Whether parser is static.
|
protected int |
tabSize |
| Constructor and Description |
|---|
JavaCharStream(java.io.InputStream dstream)
Constructor on InputStream.
|
JavaCharStream(java.io.InputStream dstream,
int startline,
int startcolumn)
Constructor on InputStream.
|
JavaCharStream(java.io.InputStream dstream,
int startline,
int startcolumn,
int buffersize)
Constructor on InputStream.
|
JavaCharStream(java.io.InputStream dstream,
java.lang.String encoding)
Constructor on InputStream.
|
JavaCharStream(java.io.InputStream dstream,
java.lang.String encoding,
int startline,
int startcolumn)
Constructor on InputStream.
|
JavaCharStream(java.io.InputStream dstream,
java.lang.String encoding,
int startline,
int startcolumn,
int buffersize)
Constructor on InputStream.
|
JavaCharStream(java.io.Reader dstream)
Constructor on Reader.
|
JavaCharStream(java.io.Reader dstream,
int startline,
int startcolumn)
Constructor on Reader.
|
JavaCharStream(java.io.Reader dstream,
int startline,
int startcolumn,
int buffersize)
Constructor on Reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjustBeginLineColumn(int newLine,
int newCol)
Adjust line and column numbers for the start of a token.
|
protected void |
AdjustBuffSize() |
void |
backup(int amount)
Backup a number of characters.
|
char |
BeginToken()
Get starting character for token.
|
void |
Done()
Set buffers back to null when finished.
|
protected void |
ExpandBuff(boolean wrapAround) |
protected void |
FillBuff() |
int |
getBeginColumn()
Get the token beginning character column number.
|
int |
getBeginLine()
Get the token beginning character line number.
|
int |
getEndColumn()
Get the token ending character column number.
|
int |
getEndLine()
Get the token ending character line number.
|
java.lang.String |
GetImage()
Get the token image.
|
char[] |
GetSuffix(int len)
Get the suffix.
|
int |
getTabSize() |
protected char |
ReadByte() |
char |
readChar()
Read a character.
|
void |
ReInit(java.io.InputStream dstream)
Reinitialise on InputStream.
|
void |
ReInit(java.io.InputStream dstream,
int startline,
int startcolumn)
Reinitialise on InputStream.
|
void |
ReInit(java.io.InputStream dstream,
int startline,
int startcolumn,
int buffersize)
Reinitialise on InputStream.
|
void |
ReInit(java.io.InputStream dstream,
java.lang.String encoding)
Reinitialise on InputStream.
|
void |
ReInit(java.io.InputStream dstream,
java.lang.String encoding,
int startline,
int startcolumn)
Reinitialise on InputStream.
|
void |
ReInit(java.io.InputStream dstream,
java.lang.String encoding,
int startline,
int startcolumn,
int buffersize)
Reinitialise on InputStream.
|
void |
ReInit(java.io.Reader dstream)
Reinitialise on Reader.
|
void |
ReInit(java.io.Reader dstream,
int startline,
int startcolumn)
Reinitialise on Reader.
|
void |
ReInit(java.io.Reader dstream,
int startline,
int startcolumn,
int buffersize)
Reinitialise on Reader.
|
void |
setTabSize(int i) |
protected void |
UpdateLineColumn(char c) |
public static final boolean staticFlag
protected java.io.Reader inputStream
public int bufpos
protected char[] buffer
protected int maxNextCharInd
protected int inBuf
protected char[] nextCharBuf
protected int nextCharInd
protected int[] bufline
protected int[] bufcolumn
protected int line
protected int column
protected boolean prevCharIsCR
protected boolean prevCharIsLF
protected int tabSize
public JavaCharStream(java.io.Reader dstream,
int startline,
int startcolumn,
int buffersize)
public JavaCharStream(java.io.Reader dstream,
int startline,
int startcolumn)
public JavaCharStream(java.io.Reader dstream)
public JavaCharStream(java.io.InputStream dstream,
java.lang.String encoding,
int startline,
int startcolumn,
int buffersize)
throws java.io.UnsupportedEncodingException
dstream - - the underlying data sourceencoding - - the character encoding of the data streamstartline - - line number of the first character of the stream, mostly for error messagesstartcolumn - - column number of the first character of the streambuffersize - - size of the bufferjava.io.UnsupportedEncodingException - if encoding is invalid or unsupportedpublic JavaCharStream(java.io.InputStream dstream,
int startline,
int startcolumn,
int buffersize)
dstream - - the underlying data sourcestartline - - line number of the first character of the stream, mostly for error messagesstartcolumn - - column number of the first character of the streambuffersize - - size of the bufferpublic JavaCharStream(java.io.InputStream dstream,
java.lang.String encoding,
int startline,
int startcolumn)
throws java.io.UnsupportedEncodingException
dstream - - the underlying data sourceencoding - - the character encoding of the data streamstartline - - line number of the first character of the stream, mostly for error messagesstartcolumn - - column number of the first character of the streamjava.io.UnsupportedEncodingException - if encoding is invalid or unsupportedpublic JavaCharStream(java.io.InputStream dstream,
int startline,
int startcolumn)
dstream - - the underlying data sourcestartline - - line number of the first character of the stream, mostly for error messagesstartcolumn - - column number of the first character of the streampublic JavaCharStream(java.io.InputStream dstream,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
dstream - - the underlying data sourceencoding - - the character encoding of the data streamjava.io.UnsupportedEncodingException - if encoding is invalid or unsupportedpublic JavaCharStream(java.io.InputStream dstream)
dstream - - the underlying data sourcepublic char BeginToken()
throws java.io.IOException
java.io.IOExceptionpublic char readChar()
throws java.io.IOException
java.io.IOExceptionprotected void AdjustBuffSize()
protected void ExpandBuff(boolean wrapAround)
protected char ReadByte()
throws java.io.IOException
java.io.IOExceptionprotected void FillBuff()
throws java.io.IOException
java.io.IOExceptionprotected void UpdateLineColumn(char c)
public void backup(int amount)
public void Done()
public java.lang.String GetImage()
public char[] GetSuffix(int len)
len - - the length of the array to return.public void ReInit(java.io.Reader dstream,
int startline,
int startcolumn,
int buffersize)
public void ReInit(java.io.Reader dstream,
int startline,
int startcolumn)
public void ReInit(java.io.Reader dstream)
public void ReInit(java.io.InputStream dstream,
java.lang.String encoding,
int startline,
int startcolumn,
int buffersize)
throws java.io.UnsupportedEncodingException
dstream - - the underlying data sourceencoding - - the character encoding of the data streamstartline - - line number of the first character of the stream, mostly for error messagesstartcolumn - - column number of the first character of the streambuffersize - - size of the bufferjava.io.UnsupportedEncodingException - if encoding is invalid or unsupportedpublic void ReInit(java.io.InputStream dstream,
int startline,
int startcolumn,
int buffersize)
dstream - - the underlying data sourcestartline - - line number of the first character of the stream, mostly for error messagesstartcolumn - - column number of the first character of the streambuffersize - - size of the bufferpublic void ReInit(java.io.InputStream dstream,
java.lang.String encoding,
int startline,
int startcolumn)
throws java.io.UnsupportedEncodingException
dstream - - the underlying data sourceencoding - - the character encoding of the data streamstartline - - line number of the first character of the stream, mostly for error messagesstartcolumn - - column number of the first character of the streamjava.io.UnsupportedEncodingException - if encoding is invalid or unsupportedpublic void ReInit(java.io.InputStream dstream,
int startline,
int startcolumn)
dstream - - the underlying data sourcestartline - - line number of the first character of the stream, mostly for error messagesstartcolumn - - column number of the first character of the streampublic void ReInit(java.io.InputStream dstream,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
dstream - - the underlying data sourceencoding - - the character encoding of the data streamjava.io.UnsupportedEncodingException - if encoding is invalid or unsupportedpublic void ReInit(java.io.InputStream dstream)
dstream - - the underlying data sourcepublic int getBeginLine()
public int getBeginColumn()
public int getEndLine()
public int getEndColumn()
public void adjustBeginLineColumn(int newLine,
int newCol)
newLine - - the new line number.newCol - - the new column number.public int getTabSize()
public void setTabSize(int i)