com.jeffpalm.javaparser
Class JavaCharStream

java.lang.Object
  extended by com.jeffpalm.javaparser.CharStream
      extended by com.jeffpalm.javaparser.JavaCharStream

public class JavaCharStream
extends CharStream

An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (with java-like unicode escape processing).

Since:
2.8.00
Version:
$Id: JavaCharStream.java,v 1.1 2005/01/09 18:51:46 jeffpalm Exp $
Author:
Mike Atkinson

Field Summary
protected  char[] nextCharBuf
           
protected  int nextCharInd
           
 
Fields inherited from class com.jeffpalm.javaparser.CharStream
ASCII, available, bufcolumn, buffer, bufline, bufpos, bufsize, column, FULL_CHAR, inBuf, inputStream, JAVA_LIKE, line, maxNextCharInd, prevCharIsCR, prevCharIsLF, staticFlag, tokenBegin, UNICODE
 
Constructor Summary
JavaCharStream(java.io.Reader dstream)
           
JavaCharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize)
           
 
Method Summary
 void adjustBeginLineColumn(int newLine, int newCol)
          Method to adjust line and column numbers for the start of a token.
protected  void AdjustBuffSize()
           
 void backup(int amount)
          Description of the Method
 char BeginToken()
          Description of the Method
 void Done()
           
protected  void ExpandBuff(boolean wrapAround)
           
protected  void FillBuff()
           
 java.lang.String GetImage()
          Description of the Method
 char[] GetSuffix(int len)
          Description of the Method
 char readChar()
          Description of the Method
protected  char ReadChar()
           
 void ReInit(java.io.Reader dstream, int startline, int startcolumn, int buffersize)
          Description of the Method
protected  void UpdateLineColumn(char c)
           
 
Methods inherited from class com.jeffpalm.javaparser.CharStream
getBeginColumn, getBeginLine, getColumn, getEndColumn, getEndLine, getLine, make, make, make, make, ReInit, ReInit, ReInit, setCharStreamType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nextCharBuf

protected char[] nextCharBuf

nextCharInd

protected int nextCharInd
Constructor Detail

JavaCharStream

public JavaCharStream(java.io.Reader dstream)

JavaCharStream

public JavaCharStream(java.io.Reader dstream,
                      int startline,
                      int startcolumn,
                      int buffersize)
Method Detail

ExpandBuff

protected void ExpandBuff(boolean wrapAround)

FillBuff

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

ReadChar

protected char ReadChar()
                 throws java.io.IOException
Throws:
java.io.IOException

BeginToken

public char BeginToken()
                throws java.io.IOException
Description copied from class: CharStream
Description of the Method

Overrides:
BeginToken in class CharStream
Returns:
Description of the Returned Value
Throws:
java.io.IOException - Description of Exception

AdjustBuffSize

protected void AdjustBuffSize()

UpdateLineColumn

protected void UpdateLineColumn(char c)

readChar

public char readChar()
              throws java.io.IOException
Description copied from class: CharStream
Description of the Method

Specified by:
readChar in class CharStream
Returns:
Description of the Returned Value
Throws:
java.io.IOException - Description of Exception

backup

public void backup(int amount)
Description copied from class: CharStream
Description of the Method

Specified by:
backup in class CharStream
Parameters:
amount - Description of Parameter

ReInit

public void ReInit(java.io.Reader dstream,
                   int startline,
                   int startcolumn,
                   int buffersize)
Description copied from class: CharStream
Description of the Method

Specified by:
ReInit in class CharStream
Parameters:
dstream - Description of Parameter
startline - Description of Parameter
startcolumn - Description of Parameter
buffersize - Description of Parameter

GetImage

public java.lang.String GetImage()
Description copied from class: CharStream
Description of the Method

Specified by:
GetImage in class CharStream
Returns:
Description of the Returned Value

GetSuffix

public char[] GetSuffix(int len)
Description copied from class: CharStream
Description of the Method

Specified by:
GetSuffix in class CharStream
Parameters:
len - Description of Parameter
Returns:
Description of the Returned Value

Done

public void Done()

adjustBeginLineColumn

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

Specified by:
adjustBeginLineColumn in class CharStream
Parameters:
newLine - Description of Parameter
newCol - Description of Parameter