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
Type Description
boolean

Constructors

SimpleCharStream(InputStream dstream)

public SimpleCharStream(InputStream dstream)

Constructor.

Parameter
Name Description
dstream InputStream

SimpleCharStream(InputStream dstream, int startline, int startcolumn)

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

Constructor.

Parameters
Name Description
dstream InputStream
startline int
startcolumn int

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

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

Constructor.

Parameters
Name Description
dstream InputStream
startline int
startcolumn int
buffersize int

SimpleCharStream(InputStream dstream, String encoding)

public SimpleCharStream(InputStream dstream, String encoding)

Constructor.

Parameters
Name Description
dstream InputStream
encoding String

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

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

Constructor.

Parameters
Name Description
dstream InputStream
encoding String
startline int
startcolumn int

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
Name Description
dstream InputStream
encoding String
startline int
startcolumn int
buffersize int

SimpleCharStream(Reader dstream)

public SimpleCharStream(Reader dstream)

Constructor.

Parameter
Name Description
dstream Reader

SimpleCharStream(Reader dstream, int startline, int startcolumn)

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

Constructor.

Parameters
Name Description
dstream Reader
startline int
startcolumn int

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

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

Constructor.

Parameters
Name Description
dstream Reader
startline int
startcolumn int
buffersize int

Fields

bufcolumn

protected int[] bufcolumn
Field Value
Type Description
int[]

buffer

protected char[] buffer
Field Value
Type Description
char[]

bufline

protected int[] bufline
Field Value
Type Description
int[]

bufpos

public int bufpos

Position in buffer.

Field Value
Type Description
int

column

protected int column
Field Value
Type Description
int

inBuf

protected int inBuf
Field Value
Type Description
int

inputStream

protected Reader inputStream
Field Value
Type Description
Reader

line

protected int line
Field Value
Type Description
int

maxNextCharInd

protected int maxNextCharInd
Field Value
Type Description
int

prevCharIsCR

protected boolean prevCharIsCR
Field Value
Type Description
boolean

prevCharIsLF

protected boolean prevCharIsLF
Field Value
Type Description
boolean

tabSize

protected int tabSize
Field Value
Type Description
int

trackLineColumn

protected boolean trackLineColumn
Field Value
Type Description
boolean

Methods

BeginToken()

public char BeginToken()

Start.

Returns
Type Description
char
Exceptions
Type Description
IOException

Done()

public void Done()

Reset buffer when finished.

ExpandBuff(boolean wrapAround)

protected void ExpandBuff(boolean wrapAround)
Parameter
Name Description
wrapAround boolean

FillBuff()

protected void FillBuff()
Exceptions
Type Description
IOException

GetImage()

public String GetImage()

Get token literal value.

Returns
Type Description
String

GetSuffix(int len)

public char[] GetSuffix(int len)

Get the suffix.

Parameter
Name Description
len int
Returns
Type Description
char[]

ReInit(InputStream dstream)

public void ReInit(InputStream dstream)

Reinitialise.

Parameter
Name Description
dstream InputStream

ReInit(InputStream dstream, int startline, int startcolumn)

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

Reinitialise.

Parameters
Name Description
dstream InputStream
startline int
startcolumn int

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

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

Reinitialise.

Parameters
Name Description
dstream InputStream
startline int
startcolumn int
buffersize int

ReInit(InputStream dstream, String encoding)

public void ReInit(InputStream dstream, String encoding)

Reinitialise.

Parameters
Name Description
dstream InputStream
encoding String
Exceptions
Type Description
UnsupportedEncodingException

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

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

Reinitialise.

Parameters
Name Description
dstream InputStream
encoding String
startline int
startcolumn int
Exceptions
Type Description
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
Name Description
dstream InputStream
encoding String
startline int
startcolumn int
buffersize int
Exceptions
Type Description
UnsupportedEncodingException

ReInit(Reader dstream)

public void ReInit(Reader dstream)

Reinitialise.

Parameter
Name Description
dstream Reader

ReInit(Reader dstream, int startline, int startcolumn)

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

Reinitialise.

Parameters
Name Description
dstream Reader
startline int
startcolumn int

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

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

Reinitialise.

Parameters
Name Description
dstream Reader
startline int
startcolumn int
buffersize int

UpdateLineColumn(char c)

protected void UpdateLineColumn(char c)
Parameter
Name Description
c char

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
Name Description
newLine int
newCol int

backup(int amount)

public void backup(int amount)

Backup a number of characters.

Parameter
Name Description
amount int

getBeginColumn()

public int getBeginColumn()

Get token beginning column number.

Returns
Type Description
int

getBeginLine()

public int getBeginLine()

Get token beginning line number.

Returns
Type Description
int

getColumn() (deprecated)

public int getColumn()

Deprecated.

See Also: #getEndColumn

Returns
Type Description
int

getEndColumn()

public int getEndColumn()

Get token end column number.

Returns
Type Description
int

getEndLine()

public int getEndLine()

Get token end line number.

Returns
Type Description
int

getLine() (deprecated)

public int getLine()

Deprecated.

See Also: #getEndLine

Returns
Type Description
int

getTabSize()

public int getTabSize()
Returns
Type Description
int

readChar()

public char readChar()

Read a character.

Returns
Type Description
char
Exceptions
Type Description
IOException

setTabSize(int i)

public void setTabSize(int i)
Parameter
Name Description
i int