org.exolab.castor.xml.dtd.parser
public final class InputCharStream extends Object implements CharStream
CharStream
.
Implements input character stream
that maintains line and column number positions of the characters.
It also has the capability to backup the stream to some extent.java.io.Reader java.io.Reader
reader and it is left to
constructor of the reader to set up character encoding correctly.
This means that method read of
the reader is used to get next characters, assuming it returns
appropriate values. It is recommended to use class
java.io.InputStreamReader java.io.InputStreamReader
as a reader, which allows to set desired character encoding.
This class is an intermediate component between input
character reader and the parser. CharStream
,
that JavaCC would have generated with
the following options set in a JavaCC grammar file: JAVA_UNICODE_ESCAPE = false; UNICODE_INPUT = false; USER_CHAR_STREAM = false;Note that this class is not fully JavaCC generated.
Version: $Revision: 5962 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Field Summary | |
---|---|
int | available |
int | bufpos |
int | bufsize |
static boolean | staticFlag |
int | tokenBegin |
Constructor Summary | |
---|---|
InputCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Constructor, allowing to specify start line and start column of the char
stream, and buffer size as well. | |
InputCharStream(Reader dstream, int startline, int startcolumn)
Constructor, allowing to specify start line and start column
of the char stream. | |
InputCharStream(Reader dstream)
Constructor, instantiating the char stream to begin at 1-st line and
1-st column of dstream. |
Method Summary | |
---|---|
void | adjustBeginLineColumn(int newLine, int newCol)
Method to adjust line and column numbers for the start of a token. |
void | backup(int amount) |
char | BeginToken() |
void | Done() |
int | getBeginColumn() |
int | getBeginLine() |
int | getColumn() |
int | getEndColumn() |
int | getEndLine() |
int | getLine() |
String | GetImage() |
char[] | GetSuffix(int len) |
char | readChar()
Returns the next character from the input stream. |
void | ReInit(Reader dstream, int startline, int startcolumn, int buffersize)
Reinitialization of the char stream, allowing to specify start line
and start column of the char stream, and buffer size as well. |
void | ReInit(Reader dstream, int startline, int startcolumn)
Reinitialization of the char stream, allowing to specify start line
and start column of the char stream. |
void | ReInit(Reader dstream)
Reinitialization of the char stream, instantiating the char stream
to begin at 1-st line and 1-st column of dstream. |
Deprecated:
See Also: InputCharStream
Deprecated:
See Also: InputCharStream