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

Field Summary
intavailable
intbufpos
intbufsize
static booleanstaticFlag
inttokenBegin
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
voidadjustBeginLineColumn(int newLine, int newCol)
Method to adjust line and column numbers for the start of a token.
voidbackup(int amount)
charBeginToken()
voidDone()
intgetBeginColumn()
intgetBeginLine()
intgetColumn()
intgetEndColumn()
intgetEndLine()
intgetLine()
StringGetImage()
char[]GetSuffix(int len)
charreadChar()
Returns the next character from the input stream.
voidReInit(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.
voidReInit(Reader dstream, int startline, int startcolumn)
Reinitialization of the char stream, allowing to specify start line and start column of the char stream.
voidReInit(Reader dstream)
Reinitialization of the char stream, instantiating the char stream to begin at 1-st line and 1-st column of dstream.

Field Detail

available

int available

bufpos

public int bufpos

bufsize

int bufsize

staticFlag

public static final boolean staticFlag

tokenBegin

int tokenBegin

Constructor Detail

InputCharStream

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.

InputCharStream

public InputCharStream(Reader dstream, int startline, int startcolumn)
Constructor, allowing to specify start line and start column of the char stream.

InputCharStream

public InputCharStream(Reader dstream)
Constructor, instantiating the char stream to begin at 1-st line and 1-st column of dstream.

Method Detail

adjustBeginLineColumn

public void adjustBeginLineColumn(int newLine, int newCol)
Method to adjust line and column numbers for the start of a token.

backup

public final void backup(int amount)

BeginToken

public final char BeginToken()

Done

public void Done()

getBeginColumn

public final int getBeginColumn()

getBeginLine

public final int getBeginLine()

getColumn

public final int getColumn()

Deprecated:

See Also: InputCharStream

getEndColumn

public final int getEndColumn()

getEndLine

public final int getEndLine()

getLine

public final int getLine()

Deprecated:

See Also: InputCharStream

GetImage

public final String GetImage()

GetSuffix

public final char[] GetSuffix(int len)

readChar

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.

ReInit

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.

ReInit

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.

ReInit

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