org.exolab.castor.xml.dtd.parser
Class InputCharStream
public final
class
InputCharStream
extends Object
implements CharStream
An implementation of interface
{@link org.exolab.castor.xml.dtd.parser.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.
The object of this class is constructed using
{@link 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
{@link 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.
The code of this class is based on the class
ASCII_CharStream - implementation
of interface
{@link org.exolab.castor.xml.dtd.parser.CharStream 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: 1.1.1.1 $ $Date: 2003/03/03 07:09:26 $
Author: JavaCC, Alexander Totok
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. |
int available
public int bufpos
int bufsize
public static final boolean staticFlag
int tokenBegin
public 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.
public InputCharStream(Reader dstream, int startline, int startcolumn)
Constructor, allowing to specify start line and start column
of the char stream.
public InputCharStream(Reader dstream)
Constructor, instantiating the char stream to begin at 1-st line and
1-st column of dstream.
public void adjustBeginLineColumn(int newLine, int newCol)
Method to adjust line and column numbers for the start of a token.
public final void backup(int amount)
public final char BeginToken()
public void Done()
public final int getBeginColumn()
public final int getBeginLine()
public final int getColumn()
public final int getEndColumn()
public final int getEndLine()
public final int getLine()
public final String GetImage()
public final char[] GetSuffix(int len)
public final char readChar()
Returns the next character from the input stream. The only method whose
implementation is different from its original in the ASCII_CharStream class.
public 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.
public 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.
public 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.
Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com