Package net.sourceforge.pmd.lang.ast
Class JavaCharStream
- java.lang.Object
-
- net.sourceforge.pmd.lang.ast.JavaCharStream
-
- All Implemented Interfaces:
CharStream
@Deprecated @InternalApi public class JavaCharStream extends Object implements CharStream
Deprecated.An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (with java-like unicode escape processing).
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
bufcolumn
Deprecated.protected char[]
buffer
Deprecated.protected int[]
bufline
Deprecated.int
bufpos
Deprecated.Position in buffer.protected int
column
Deprecated.protected int
inBuf
Deprecated.protected Reader
inputStream
Deprecated.protected int
line
Deprecated.protected int
maxNextCharInd
Deprecated.protected char[]
nextCharBuf
Deprecated.protected int
nextCharInd
Deprecated.protected boolean
prevCharIsCR
Deprecated.protected boolean
prevCharIsLF
Deprecated.static boolean
staticFlag
Deprecated.Whether parser is static.protected int
tabSize
Deprecated.
-
Constructor Summary
Constructors Constructor Description JavaCharStream(InputStream dstream)
Deprecated.Constructor.JavaCharStream(InputStream dstream, int startline, int startcolumn)
Deprecated.Constructor.JavaCharStream(InputStream dstream, int startline, int startcolumn, int buffersize)
Deprecated.Constructor.JavaCharStream(InputStream dstream, String encoding)
Deprecated.Constructor.JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn)
Deprecated.Constructor.JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Deprecated.Constructor.JavaCharStream(Reader dstream)
Deprecated.Constructor.JavaCharStream(Reader dstream, int startline, int startcolumn)
Deprecated.Constructor.JavaCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
adjustBeginLineColumn(int newLine, int newCol)
Deprecated.Method to adjust line and column numbers for the start of a token.protected void
AdjustBuffSize()
Deprecated.void
backup(int amount)
Deprecated.Retreat.char
BeginToken()
Deprecated.Returns the next character that marks the beginning of the next token.void
Done()
Deprecated.Set buffers back to null when finished.protected void
ExpandBuff(boolean wrapAround)
Deprecated.protected void
FillBuff()
Deprecated.int
getBeginColumn()
Deprecated.Returns the column number of the first character for current token (being matched after the last call to BeginTOken).int
getBeginLine()
Deprecated.Returns the line number of the first character for current token (being matched after the last call to BeginTOken).int
getColumn()
Deprecated.int
getEndColumn()
Deprecated.Get end column.int
getEndLine()
Deprecated.Get end line.String
GetImage()
Deprecated.Returns a string made up of characters from the marked token beginning to the current buffer position.int
getLine()
Deprecated.char[]
GetSuffix(int len)
Deprecated.Returns an array of characters that make up the suffix of length 'len' for the currently matched token.protected int
getTabSize(int i)
Deprecated.protected char
ReadByte()
Deprecated.char
readChar()
Deprecated.Read a character.void
ReInit(InputStream dstream)
Deprecated.Reinitialise.void
ReInit(InputStream dstream, int startline, int startcolumn)
Deprecated.Reinitialise.void
ReInit(InputStream dstream, int startline, int startcolumn, int buffersize)
Deprecated.Reinitialise.void
ReInit(InputStream dstream, String encoding)
Deprecated.Reinitialise.void
ReInit(InputStream dstream, String encoding, int startline, int startcolumn)
Deprecated.Reinitialise.void
ReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Deprecated.Reinitialise.void
ReInit(Reader dstream)
Deprecated.Reinitialise.void
ReInit(Reader dstream, int startline, int startcolumn)
Deprecated.Reinitialise.void
ReInit(Reader dstream, int startline, int startcolumn, int buffersize)
Deprecated.Reinitialise.protected void
setTabSize(int i)
Deprecated.protected void
UpdateLineColumn(char c)
Deprecated.
-
-
-
Field Detail
-
staticFlag
public static final boolean staticFlag
Deprecated.Whether parser is static.- See Also:
- Constant Field Values
-
bufpos
public int bufpos
Deprecated.Position in buffer.
-
bufline
protected int[] bufline
Deprecated.
-
bufcolumn
protected int[] bufcolumn
Deprecated.
-
column
protected int column
Deprecated.
-
line
protected int line
Deprecated.
-
prevCharIsCR
protected boolean prevCharIsCR
Deprecated.
-
prevCharIsLF
protected boolean prevCharIsLF
Deprecated.
-
inputStream
protected Reader inputStream
Deprecated.
-
nextCharBuf
protected char[] nextCharBuf
Deprecated.
-
buffer
protected char[] buffer
Deprecated.
-
maxNextCharInd
protected int maxNextCharInd
Deprecated.
-
nextCharInd
protected int nextCharInd
Deprecated.
-
inBuf
protected int inBuf
Deprecated.
-
tabSize
protected int tabSize
Deprecated.
-
-
Constructor Detail
-
JavaCharStream
public JavaCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Deprecated.Constructor.
-
JavaCharStream
public JavaCharStream(Reader dstream, int startline, int startcolumn)
Deprecated.Constructor.
-
JavaCharStream
public JavaCharStream(Reader dstream)
Deprecated.Constructor.
-
JavaCharStream
public JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException
Deprecated.Constructor.- Throws:
UnsupportedEncodingException
-
JavaCharStream
public JavaCharStream(InputStream dstream, int startline, int startcolumn, int buffersize)
Deprecated.Constructor.
-
JavaCharStream
public JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException
Deprecated.Constructor.- Throws:
UnsupportedEncodingException
-
JavaCharStream
public JavaCharStream(InputStream dstream, int startline, int startcolumn)
Deprecated.Constructor.
-
JavaCharStream
public JavaCharStream(InputStream dstream, String encoding) throws UnsupportedEncodingException
Deprecated.Constructor.- Throws:
UnsupportedEncodingException
-
JavaCharStream
public JavaCharStream(InputStream dstream)
Deprecated.Constructor.
-
-
Method Detail
-
setTabSize
protected void setTabSize(int i)
Deprecated.
-
getTabSize
protected int getTabSize(int i)
Deprecated.
-
ExpandBuff
protected void ExpandBuff(boolean wrapAround)
Deprecated.
-
FillBuff
protected void FillBuff() throws IOException
Deprecated.- Throws:
IOException
-
ReadByte
protected char ReadByte() throws IOException
Deprecated.- Throws:
IOException
-
BeginToken
public char BeginToken() throws IOException
Deprecated.Description copied from interface:CharStream
Returns the next character that marks the beginning of the next token. All characters must remain in the buffer between two successive calls to this method to implement backup correctly.- Specified by:
BeginToken
in interfaceCharStream
- Returns:
- starting character for token.
- Throws:
IOException
-
AdjustBuffSize
protected void AdjustBuffSize()
Deprecated.
-
UpdateLineColumn
protected void UpdateLineColumn(char c)
Deprecated.
-
readChar
public char readChar() throws IOException
Deprecated.Read a character.- Specified by:
readChar
in interfaceCharStream
- Throws:
IOException
-
getColumn
@Deprecated public int getColumn()
Deprecated.- Specified by:
getColumn
in interfaceCharStream
-
getLine
@Deprecated public int getLine()
Deprecated.- Specified by:
getLine
in interfaceCharStream
-
getEndColumn
public int getEndColumn()
Deprecated.Get end column.- Specified by:
getEndColumn
in interfaceCharStream
-
getEndLine
public int getEndLine()
Deprecated.Get end line.- Specified by:
getEndLine
in interfaceCharStream
-
getBeginColumn
public int getBeginColumn()
Deprecated.Description copied from interface:CharStream
Returns the column number of the first character for current token (being matched after the last call to BeginTOken).- Specified by:
getBeginColumn
in interfaceCharStream
- Returns:
- column of token start
-
getBeginLine
public int getBeginLine()
Deprecated.Description copied from interface:CharStream
Returns the line number of the first character for current token (being matched after the last call to BeginTOken).- Specified by:
getBeginLine
in interfaceCharStream
- Returns:
- line number of token start
-
backup
public void backup(int amount)
Deprecated.Retreat.- Specified by:
backup
in interfaceCharStream
-
ReInit
public void ReInit(Reader dstream, int startline, int startcolumn, int buffersize)
Deprecated.Reinitialise.
-
ReInit
public void ReInit(Reader dstream, int startline, int startcolumn)
Deprecated.Reinitialise.
-
ReInit
public void ReInit(Reader dstream)
Deprecated.Reinitialise.
-
ReInit
public void ReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException
Deprecated.Reinitialise.- Throws:
UnsupportedEncodingException
-
ReInit
public void ReInit(InputStream dstream, int startline, int startcolumn, int buffersize)
Deprecated.Reinitialise.
-
ReInit
public void ReInit(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException
Deprecated.Reinitialise.- Throws:
UnsupportedEncodingException
-
ReInit
public void ReInit(InputStream dstream, int startline, int startcolumn)
Deprecated.Reinitialise.
-
ReInit
public void ReInit(InputStream dstream, String encoding) throws UnsupportedEncodingException
Deprecated.Reinitialise.- Throws:
UnsupportedEncodingException
-
ReInit
public void ReInit(InputStream dstream)
Deprecated.Reinitialise.
-
GetImage
public String GetImage()
Deprecated.Description copied from interface:CharStream
Returns a string made up of characters from the marked token beginning to the current buffer position. Implementations have the choice of returning anything that they want to. For example, for efficiency, one might decide to just return null, which is a valid implementation.- Specified by:
GetImage
in interfaceCharStream
- Returns:
- token image as String
-
GetSuffix
public char[] GetSuffix(int len)
Deprecated.Description copied from interface:CharStream
Returns an array of characters that make up the suffix of length 'len' for the currently matched token. This is used to build up the matched string for use in actions in the case of MORE. A simple and inefficient implementation of this is as follows : { String t = GetImage(); return t.substring(t.length() - len, t.length()).toCharArray(); }- Specified by:
GetSuffix
in interfaceCharStream
- Returns:
- suffix
-
Done
public void Done()
Deprecated.Set buffers back to null when finished.- Specified by:
Done
in interfaceCharStream
-
adjustBeginLineColumn
public void adjustBeginLineColumn(int newLine, int newCol)
Deprecated.Method to adjust line and column numbers for the start of a token.
-
-