net.sourceforge.pmd.cpd.cppast

Class SimpleCharStream

public class SimpleCharStream extends Object

An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (without unicode processing).
Field Summary
protected static int[]bufcolumn
protected static char[]buffer
protected static int[]bufline
static intbufpos
Position in buffer.
protected static intcolumn
protected static intinBuf
protected static ReaderinputStream
protected static intline
protected static intmaxNextCharInd
protected static booleanprevCharIsCR
protected static booleanprevCharIsLF
static booleanstaticFlag
Whether parser is static.
protected static inttabSize
Constructor Summary
SimpleCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Constructor.
SimpleCharStream(Reader dstream, int startline, int startcolumn)
Constructor.
SimpleCharStream(Reader dstream)
Constructor.
SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Constructor.
SimpleCharStream(InputStream dstream, int startline, int startcolumn, int buffersize)
Constructor.
SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn)
Constructor.
SimpleCharStream(InputStream dstream, int startline, int startcolumn)
Constructor.
SimpleCharStream(InputStream dstream, String encoding)
Constructor.
SimpleCharStream(InputStream dstream)
Constructor.
Method Summary
static voidadjustBeginLineColumn(int newLine, int newCol)
Method to adjust line and column numbers for the start of a token.
static voidbackup(int amount)
Backup a number of characters.
static charBeginToken()
Start.
static voidDone()
Reset buffer when finished.
protected static voidExpandBuff(boolean wrapAround)
protected static voidFillBuff()
static intgetBeginColumn()
Get token beginning column number.
static intgetBeginLine()
Get token beginning line number.
static intgetColumn()
static intgetEndColumn()
Get token end column number.
static intgetEndLine()
Get token end line number.
static intgetLine()
protected static intgetTabSize(int i)
static StringGetImage()
Get token literal value.
static char[]GetSuffix(int len)
Get the suffix.
static charreadChar()
Read a character.
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)
Reinitialise.
voidReInit(InputStream dstream)
Reinitialise.
voidReInit(InputStream dstream, String encoding, int startline, int startcolumn)
Reinitialise.
voidReInit(InputStream dstream, int startline, int startcolumn)
Reinitialise.
protected static voidsetTabSize(int i)
protected static voidUpdateLineColumn(char c)

Field Detail

bufcolumn

protected static int[] bufcolumn

buffer

protected static char[] buffer

bufline

protected static int[] bufline

bufpos

public static int bufpos
Position in buffer.

column

protected static int column

inBuf

protected static int inBuf

inputStream

protected static Reader inputStream

line

protected static int line

maxNextCharInd

protected static int maxNextCharInd

prevCharIsCR

protected static boolean prevCharIsCR

prevCharIsLF

protected static boolean prevCharIsLF

staticFlag

public static final boolean staticFlag
Whether parser is static.

tabSize

protected static int tabSize

Constructor Detail

SimpleCharStream

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

SimpleCharStream

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

SimpleCharStream

public SimpleCharStream(Reader dstream)
Constructor.

SimpleCharStream

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

SimpleCharStream

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

SimpleCharStream

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

SimpleCharStream

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

SimpleCharStream

public SimpleCharStream(InputStream dstream, String encoding)
Constructor.

SimpleCharStream

public SimpleCharStream(InputStream dstream)
Constructor.

Method Detail

adjustBeginLineColumn

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

backup

public static void backup(int amount)
Backup a number of characters.

BeginToken

public static char BeginToken()
Start.

Done

public static void Done()
Reset buffer when finished.

ExpandBuff

protected static void ExpandBuff(boolean wrapAround)

FillBuff

protected static void FillBuff()

getBeginColumn

public static int getBeginColumn()
Get token beginning column number.

getBeginLine

public static int getBeginLine()
Get token beginning line number.

getColumn

public static int getColumn()

Deprecated:

See Also: SimpleCharStream

getEndColumn

public static int getEndColumn()
Get token end column number.

getEndLine

public static int getEndLine()
Get token end line number.

getLine

public static int getLine()

Deprecated:

See Also: SimpleCharStream

getTabSize

protected static int getTabSize(int i)

GetImage

public static String GetImage()
Get token literal value.

GetSuffix

public static char[] GetSuffix(int len)
Get the suffix.

readChar

public static char readChar()
Read a character.

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)
Reinitialise.

ReInit

public void ReInit(InputStream dstream)
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.

setTabSize

protected static void setTabSize(int i)

UpdateLineColumn

protected static void UpdateLineColumn(char c)