Class SimpleCharStream (0.6.1)

public class SimpleCharStream

An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (without unicode processing).

Inheritance

java.lang.Object > SimpleCharStream

Static Fields

staticFlag

public static final boolean staticFlag

Whether parser is static.

Field Value
TypeDescription
boolean

Constructors

SimpleCharStream(InputStream dstream)

public SimpleCharStream(InputStream dstream)

Constructor.

Parameter
NameDescription
dstreamInputStream

SimpleCharStream(InputStream dstream, int startline, int startcolumn)

public SimpleCharStream(InputStream dstream, int startline, int startcolumn)

Constructor.

Parameters
NameDescription
dstreamInputStream
startlineint
startcolumnint

SimpleCharStream(InputStream dstream, int startline, int startcolumn, int buffersize)

public SimpleCharStream(InputStream dstream, int startline, int startcolumn, int buffersize)

Constructor.

Parameters
NameDescription
dstreamInputStream
startlineint
startcolumnint
buffersizeint

SimpleCharStream(InputStream dstream, String encoding)

public SimpleCharStream(InputStream dstream, String encoding)

Constructor.

Parameters
NameDescription
dstreamInputStream
encodingString

SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn)

public SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn)

Constructor.

Parameters
NameDescription
dstreamInputStream
encodingString
startlineint
startcolumnint

SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)

public SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)

Constructor.

Parameters
NameDescription
dstreamInputStream
encodingString
startlineint
startcolumnint
buffersizeint

SimpleCharStream(Reader dstream)

public SimpleCharStream(Reader dstream)

Constructor.

Parameter
NameDescription
dstreamReader

SimpleCharStream(Reader dstream, int startline, int startcolumn)

public SimpleCharStream(Reader dstream, int startline, int startcolumn)

Constructor.

Parameters
NameDescription
dstreamReader
startlineint
startcolumnint

SimpleCharStream(Reader dstream, int startline, int startcolumn, int buffersize)

public SimpleCharStream(Reader dstream, int startline, int startcolumn, int buffersize)

Constructor.

Parameters
NameDescription
dstreamReader
startlineint
startcolumnint
buffersizeint

Fields

bufcolumn

protected int[] bufcolumn
Field Value
TypeDescription
int[]

buffer

protected char[] buffer
Field Value
TypeDescription
char[]

bufline

protected int[] bufline
Field Value
TypeDescription
int[]

bufpos

public int bufpos

Position in buffer.

Field Value
TypeDescription
int

column

protected int column
Field Value
TypeDescription
int

inBuf

protected int inBuf
Field Value
TypeDescription
int

inputStream

protected Reader inputStream
Field Value
TypeDescription
Reader

line

protected int line
Field Value
TypeDescription
int

maxNextCharInd

protected int maxNextCharInd
Field Value
TypeDescription
int

prevCharIsCR

protected boolean prevCharIsCR
Field Value
TypeDescription
boolean

prevCharIsLF

protected boolean prevCharIsLF
Field Value
TypeDescription
boolean

tabSize

protected int tabSize
Field Value
TypeDescription
int

trackLineColumn

protected boolean trackLineColumn
Field Value
TypeDescription
boolean

Methods

BeginToken()

public char BeginToken()

Start.

Returns
TypeDescription
char
Exceptions
TypeDescription
IOException

Done()

public void Done()

Reset buffer when finished.

ExpandBuff(boolean wrapAround)

protected void ExpandBuff(boolean wrapAround)
Parameter
NameDescription
wrapAroundboolean

FillBuff()

protected void FillBuff()
Exceptions
TypeDescription
IOException

GetImage()

public String GetImage()

Get token literal value.

Returns
TypeDescription
String

GetSuffix(int len)

public char[] GetSuffix(int len)

Get the suffix.

Parameter
NameDescription
lenint
Returns
TypeDescription
char[]

ReInit(InputStream dstream)

public void ReInit(InputStream dstream)

Reinitialise.

Parameter
NameDescription
dstreamInputStream

ReInit(InputStream dstream, int startline, int startcolumn)

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

Reinitialise.

Parameters
NameDescription
dstreamInputStream
startlineint
startcolumnint

ReInit(InputStream dstream, int startline, int startcolumn, int buffersize)

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

Reinitialise.

Parameters
NameDescription
dstreamInputStream
startlineint
startcolumnint
buffersizeint

ReInit(InputStream dstream, String encoding)

public void ReInit(InputStream dstream, String encoding)

Reinitialise.

Parameters
NameDescription
dstreamInputStream
encodingString
Exceptions
TypeDescription
UnsupportedEncodingException

ReInit(InputStream dstream, String encoding, int startline, int startcolumn)

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

Reinitialise.

Parameters
NameDescription
dstreamInputStream
encodingString
startlineint
startcolumnint
Exceptions
TypeDescription
UnsupportedEncodingException

ReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)

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

Reinitialise.

Parameters
NameDescription
dstreamInputStream
encodingString
startlineint
startcolumnint
buffersizeint
Exceptions
TypeDescription
UnsupportedEncodingException

ReInit(Reader dstream)

public void ReInit(Reader dstream)

Reinitialise.

Parameter
NameDescription
dstreamReader

ReInit(Reader dstream, int startline, int startcolumn)

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

Reinitialise.

Parameters
NameDescription
dstreamReader
startlineint
startcolumnint

ReInit(Reader dstream, int startline, int startcolumn, int buffersize)

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

Reinitialise.

Parameters
NameDescription
dstreamReader
startlineint
startcolumnint
buffersizeint

UpdateLineColumn(char c)

protected void UpdateLineColumn(char c)
Parameter
NameDescription
cchar

adjustBeginLineColumn(int newLine, int newCol)

public void adjustBeginLineColumn(int newLine, int newCol)

Method to adjust line and column numbers for the start of a token.

Parameters
NameDescription
newLineint
newColint

backup(int amount)

public void backup(int amount)

Backup a number of characters.

Parameter
NameDescription
amountint

getBeginColumn()

public int getBeginColumn()

Get token beginning column number.

Returns
TypeDescription
int

getBeginLine()

public int getBeginLine()

Get token beginning line number.

Returns
TypeDescription
int

getColumn() (deprecated)

public int getColumn()

Deprecated.

See Also: #getEndColumn

Returns
TypeDescription
int

getEndColumn()

public int getEndColumn()

Get token end column number.

Returns
TypeDescription
int

getEndLine()

public int getEndLine()

Get token end line number.

Returns
TypeDescription
int

getLine() (deprecated)

public int getLine()

Deprecated.

See Also: #getEndLine

Returns
TypeDescription
int

getTabSize()

public int getTabSize()
Returns
TypeDescription
int

readChar()

public char readChar()

Read a character.

Returns
TypeDescription
char
Exceptions
TypeDescription
IOException

setTabSize(int i)

public void setTabSize(int i)
Parameter
NameDescription
iint