xjavadoc

Class JavaCharStream

public class JavaCharStream extends Object

An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (with java-like unicode escape processing).
Field Summary
intavailable
protected int[]bufcolumn
protected char[]buffer
protected int[]bufline
intbufpos
Position in buffer.
intbufsize
protected intcolumn
protected intinBuf
protected ReaderinputStream
protected intline
protected intmaxNextCharInd
protected char[]nextCharBuf
protected intnextCharInd
protected booleanprevCharIsCR
protected booleanprevCharIsLF
static booleanstaticFlag
Whether parser is static.
protected inttabSize
inttokenBegin
Constructor Summary
JavaCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Constructor.
JavaCharStream(Reader dstream, int startline, int startcolumn)
Constructor.
JavaCharStream(Reader dstream)
Constructor.
JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Constructor.
JavaCharStream(InputStream dstream, int startline, int startcolumn, int buffersize)
Constructor.
JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn)
Constructor.
JavaCharStream(InputStream dstream, int startline, int startcolumn)
Constructor.
JavaCharStream(InputStream dstream, String encoding)
Constructor.
JavaCharStream(InputStream dstream)
Constructor.
Method Summary
protected voidAdjustBuffSize()
voidadjustBeginLineColumn(int newLine, int newCol)
Method to adjust line and column numbers for the start of a token.
voidbackup(int amount)
Retreat.
charBeginToken()
voidDone()
Set buffers back to null when finished.
protected voidExpandBuff(boolean wrapAround)
protected voidFillBuff()
intgetBeginColumn()
intgetBeginLine()
intgetColumn()
intgetEndColumn()
Get end column.
intgetEndLine()
Get end line.
intgetLine()
protected intgetTabSize(int i)
StringGetImage()
char[]GetSuffix(int len)
static inthexval(char c)
charreadChar()
Read a character.
protected charReadByte()
voidReInit(Reader dstream, int startline, int startcolumn, int buffersize)
Reinitialise.
voidReInit(Reader dstream, int startline, int startcolumn)
Reinitialise.
voidReInit(Reader dstream)
Reinitialise.
voidReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Reinitialise.
voidReInit(InputStream dstream, int startline, int startcolumn, int buffersize)
Reinitialise.
voidReInit(InputStream dstream, String encoding, int startline, int startcolumn)
Reinitialise.
voidReInit(InputStream dstream, int startline, int startcolumn)
Reinitialise.
voidReInit(InputStream dstream, String encoding)
Reinitialise.
voidReInit(InputStream dstream)
Reinitialise.
protected voidsetTabSize(int i)
protected voidUpdateLineColumn(char c)

Field Detail

available

int available

bufcolumn

protected int[] bufcolumn

buffer

protected char[] buffer

bufline

protected int[] bufline

bufpos

public int bufpos
Position in buffer.

bufsize

int bufsize

column

protected int column

inBuf

protected int inBuf

inputStream

protected Reader inputStream

line

protected int line

maxNextCharInd

protected int maxNextCharInd

nextCharBuf

protected char[] nextCharBuf

nextCharInd

protected int nextCharInd

prevCharIsCR

protected boolean prevCharIsCR

prevCharIsLF

protected boolean prevCharIsLF

staticFlag

public static final boolean staticFlag
Whether parser is static.

tabSize

protected int tabSize

tokenBegin

int tokenBegin

Constructor Detail

JavaCharStream

public JavaCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Constructor.

JavaCharStream

public JavaCharStream(Reader dstream, int startline, int startcolumn)
Constructor.

JavaCharStream

public JavaCharStream(Reader dstream)
Constructor.

JavaCharStream

public JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Constructor.

JavaCharStream

public JavaCharStream(InputStream dstream, int startline, int startcolumn, int buffersize)
Constructor.

JavaCharStream

public JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn)
Constructor.

JavaCharStream

public JavaCharStream(InputStream dstream, int startline, int startcolumn)
Constructor.

JavaCharStream

public JavaCharStream(InputStream dstream, String encoding)
Constructor.

JavaCharStream

public JavaCharStream(InputStream dstream)
Constructor.

Method Detail

AdjustBuffSize

protected void AdjustBuffSize()

adjustBeginLineColumn

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

backup

public void backup(int amount)
Retreat.

BeginToken

public char BeginToken()

Returns: starting character for token.

Done

public void Done()
Set buffers back to null when finished.

ExpandBuff

protected void ExpandBuff(boolean wrapAround)

FillBuff

protected void FillBuff()

getBeginColumn

public int getBeginColumn()

Returns: column of token start

getBeginLine

public int getBeginLine()

Returns: line number of token start

getColumn

public int getColumn()

Deprecated:

See Also: JavaCharStream

getEndColumn

public int getEndColumn()
Get end column.

getEndLine

public int getEndLine()
Get end line.

getLine

public int getLine()

Deprecated:

See Also: JavaCharStream

getTabSize

protected int getTabSize(int i)

GetImage

public String GetImage()

Returns: token image as String

GetSuffix

public char[] GetSuffix(int len)

Returns: suffix

hexval

static final int hexval(char c)

readChar

public char readChar()
Read a character.

ReadByte

protected char ReadByte()

ReInit

public void ReInit(Reader dstream, int startline, int startcolumn, int buffersize)
Reinitialise.

ReInit

public void ReInit(Reader dstream, int startline, int startcolumn)
Reinitialise.

ReInit

public void ReInit(Reader dstream)
Reinitialise.

ReInit

public void ReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Reinitialise.

ReInit

public void ReInit(InputStream dstream, int startline, int startcolumn, int buffersize)
Reinitialise.

ReInit

public void ReInit(InputStream dstream, String encoding, int startline, int startcolumn)
Reinitialise.

ReInit

public void ReInit(InputStream dstream, int startline, int startcolumn)
Reinitialise.

ReInit

public void ReInit(InputStream dstream, String encoding)
Reinitialise.

ReInit

public void ReInit(InputStream dstream)
Reinitialise.

setTabSize

protected void setTabSize(int i)

UpdateLineColumn

protected void UpdateLineColumn(char c)