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