net.sourceforge.pmd.cpd.cppast
Class SimpleCharStream

java.lang.Object
  extended by net.sourceforge.pmd.cpd.cppast.SimpleCharStream

public class SimpleCharStream
extends java.lang.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 int bufpos
          Position in buffer.
protected static int column
           
protected static int inBuf
           
protected static java.io.Reader inputStream
           
protected static int line
           
protected static int maxNextCharInd
           
protected static boolean prevCharIsCR
           
protected static boolean prevCharIsLF
           
static boolean staticFlag
          Whether parser is static.
protected static int tabSize
           
 
Constructor Summary
SimpleCharStream(java.io.InputStream dstream)
          Constructor.
SimpleCharStream(java.io.InputStream dstream, int startline, int startcolumn)
          Constructor.
SimpleCharStream(java.io.InputStream dstream, int startline, int startcolumn, int buffersize)
          Constructor.
SimpleCharStream(java.io.InputStream dstream, java.lang.String encoding)
          Constructor.
SimpleCharStream(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn)
          Constructor.
SimpleCharStream(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn, int buffersize)
          Constructor.
SimpleCharStream(java.io.Reader dstream)
          Constructor.
SimpleCharStream(java.io.Reader dstream, int startline, int startcolumn)
          Constructor.
SimpleCharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize)
          Constructor.
 
Method Summary
static void adjustBeginLineColumn(int newLine, int newCol)
          Method to adjust line and column numbers for the start of a token.
static void backup(int amount)
          Backup a number of characters.
static char BeginToken()
          Start.
static void Done()
          Reset buffer when finished.
protected static void ExpandBuff(boolean wrapAround)
           
protected static void FillBuff()
           
static int getBeginColumn()
          Get token beginning column number.
static int getBeginLine()
          Get token beginning line number.
static int getColumn()
          Deprecated.  
static int getEndColumn()
          Get token end column number.
static int getEndLine()
          Get token end line number.
static java.lang.String GetImage()
          Get token literal value.
static int getLine()
          Deprecated.  
static char[] GetSuffix(int len)
          Get the suffix.
protected static int getTabSize(int i)
           
static char readChar()
          Read a character.
 void ReInit(java.io.InputStream dstream)
          Reinitialise.
 void ReInit(java.io.InputStream dstream, int startline, int startcolumn)
          Reinitialise.
 void ReInit(java.io.InputStream dstream, int startline, int startcolumn, int buffersize)
          Reinitialise.
 void ReInit(java.io.InputStream dstream, java.lang.String encoding)
          Reinitialise.
 void ReInit(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn)
          Reinitialise.
 void ReInit(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn, int buffersize)
          Reinitialise.
 void ReInit(java.io.Reader dstream)
          Reinitialise.
 void ReInit(java.io.Reader dstream, int startline, int startcolumn)
          Reinitialise.
 void ReInit(java.io.Reader dstream, int startline, int startcolumn, int buffersize)
          Reinitialise.
protected static void setTabSize(int i)
           
protected static void UpdateLineColumn(char c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

staticFlag

public static final boolean staticFlag
Whether parser is static.

See Also:
Constant Field Values

bufpos

public static int bufpos
Position in buffer.


bufline

protected static int[] bufline

bufcolumn

protected static int[] bufcolumn

column

protected static int column

line

protected static int line

prevCharIsCR

protected static boolean prevCharIsCR

prevCharIsLF

protected static boolean prevCharIsLF

inputStream

protected static java.io.Reader inputStream

buffer

protected static char[] buffer

maxNextCharInd

protected static int maxNextCharInd

inBuf

protected static int inBuf

tabSize

protected static int tabSize
Constructor Detail

SimpleCharStream

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


SimpleCharStream

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


SimpleCharStream

public SimpleCharStream(java.io.Reader dstream)
Constructor.


SimpleCharStream

public SimpleCharStream(java.io.InputStream dstream,
                        java.lang.String encoding,
                        int startline,
                        int startcolumn,
                        int buffersize)
                 throws java.io.UnsupportedEncodingException
Constructor.

Throws:
java.io.UnsupportedEncodingException

SimpleCharStream

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


SimpleCharStream

public SimpleCharStream(java.io.InputStream dstream,
                        java.lang.String encoding,
                        int startline,
                        int startcolumn)
                 throws java.io.UnsupportedEncodingException
Constructor.

Throws:
java.io.UnsupportedEncodingException

SimpleCharStream

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


SimpleCharStream

public SimpleCharStream(java.io.InputStream dstream,
                        java.lang.String encoding)
                 throws java.io.UnsupportedEncodingException
Constructor.

Throws:
java.io.UnsupportedEncodingException

SimpleCharStream

public SimpleCharStream(java.io.InputStream dstream)
Constructor.

Method Detail

setTabSize

protected static void setTabSize(int i)

getTabSize

protected static int getTabSize(int i)

ExpandBuff

protected static void ExpandBuff(boolean wrapAround)

FillBuff

protected static void FillBuff()
                        throws java.io.IOException
Throws:
java.io.IOException

BeginToken

public static char BeginToken()
                       throws java.io.IOException
Start.

Throws:
java.io.IOException

UpdateLineColumn

protected static void UpdateLineColumn(char c)

readChar

public static char readChar()
                     throws java.io.IOException
Read a character.

Throws:
java.io.IOException

getColumn

public static int getColumn()
Deprecated. 

See Also:
getEndColumn()

getLine

public static int getLine()
Deprecated. 

See Also:
getEndLine()

getEndColumn

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


getEndLine

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


getBeginColumn

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


getBeginLine

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


backup

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


ReInit

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


ReInit

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


ReInit

public void ReInit(java.io.Reader dstream)
Reinitialise.


ReInit

public void ReInit(java.io.InputStream dstream,
                   java.lang.String encoding,
                   int startline,
                   int startcolumn,
                   int buffersize)
            throws java.io.UnsupportedEncodingException
Reinitialise.

Throws:
java.io.UnsupportedEncodingException

ReInit

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


ReInit

public void ReInit(java.io.InputStream dstream,
                   java.lang.String encoding)
            throws java.io.UnsupportedEncodingException
Reinitialise.

Throws:
java.io.UnsupportedEncodingException

ReInit

public void ReInit(java.io.InputStream dstream)
Reinitialise.


ReInit

public void ReInit(java.io.InputStream dstream,
                   java.lang.String encoding,
                   int startline,
                   int startcolumn)
            throws java.io.UnsupportedEncodingException
Reinitialise.

Throws:
java.io.UnsupportedEncodingException

ReInit

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


GetImage

public static java.lang.String GetImage()
Get token literal value.


GetSuffix

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


Done

public static void Done()
Reset buffer when finished.


adjustBeginLineColumn

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



Copyright © 2002-2011 InfoEther. All Rights Reserved.