Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

public final Class UCode_CharStream

extends Object
implements CharStream
Class Inheritance
All Implemented Interfaces
org.apache.derby.impl.sql.compile.CharStream

An implementation of interface CharStream, where the stream is assumed to contain only Unicode characters.

Field Summary

Modifier and TypeField and Description
pack-priv int
private int[]
private char[]
private int[]
public int
pack-priv int
pack-priv int
pack-priv int[]
private int
private int
private Reader
private int
private int
private char[]
private int
private boolean
private boolean
public static final boolean
pack-priv int

Constructor Summary

AccessConstructor and Description
public
UCode_CharStream(Reader dstream, int startline, int startcolumn, int buffersize)

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

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

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

Method Summary

Modifier and TypeMethod and Description
public void
adjustBeginLineColumn(int newLine, int newCol)

Method to adjust line and column numbers for the start of a token.

public final void
backup(int amount)

Implements org.apache.derby.impl.sql.compile.CharStream.backup.

Backs up the input stream by amount steps.

public char
BeginToken()

Implements org.apache.derby.impl.sql.compile.CharStream.BeginToken.

Returns the next character that marks the beginning of the next token.

public void
Done()

Implements org.apache.derby.impl.sql.compile.CharStream.Done.

The lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class.

private void
ExpandBuff(boolean wrapAround)

private void
public final int
getBeginColumn()

Implements org.apache.derby.impl.sql.compile.CharStream.getBeginColumn.

Returns the column number of the first character for current token (being matched after the last call to BeginTOken).

public final int
getBeginLine()

Implements org.apache.derby.impl.sql.compile.CharStream.getBeginLine.

Returns the line number of the first character for current token (being matched after the last call to BeginTOken).

public final int
public final int
getColumn()

Implements org.apache.derby.impl.sql.compile.CharStream.getColumn.

Deprecated

Returns the column position of the character last read.

public final int
getEndColumn()

Implements org.apache.derby.impl.sql.compile.CharStream.getEndColumn.

Returns the column number of the last character for current token (being matched after the last call to BeginTOken).

public final int
getEndLine()

Implements org.apache.derby.impl.sql.compile.CharStream.getEndLine.

Returns the line number of the last character for current token (being matched after the last call to BeginTOken).

public final int
public final String
GetImage()

Implements org.apache.derby.impl.sql.compile.CharStream.GetImage.

Returns a string made up of characters from the marked token beginning to the current buffer position.

public final int
getLine()

Implements org.apache.derby.impl.sql.compile.CharStream.getLine.

Deprecated

Returns the line number of the character last read.

public final char[]
GetSuffix(int len)

Implements org.apache.derby.impl.sql.compile.CharStream.GetSuffix.

Returns an array of characters that make up the suffix of length 'len' for the currently matched token.

private char
public final char
readChar()

Implements org.apache.derby.impl.sql.compile.CharStream.readChar.

Returns the next character from the selected input.

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

Implements org.apache.derby.impl.sql.compile.CharStream.ReInit.

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

Implements org.apache.derby.impl.sql.compile.CharStream.ReInit.

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

Implements org.apache.derby.impl.sql.compile.CharStream.ReInit.

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

Implements org.apache.derby.impl.sql.compile.CharStream.ReInit.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

availableback to summary
pack-priv int available
bufcolumnback to summary
private int[] bufcolumn
bufferback to summary
private char[] buffer
buflineback to summary
private int[] bufline
bufposback to summary
public int bufpos
bufsizeback to summary
pack-priv int bufsize
charCntback to summary
pack-priv int charCnt
charOffsetback to summary
pack-priv int[] charOffset
columnback to summary
private int column
inBufback to summary
private int inBuf
inputStreamback to summary
private Reader inputStream
lineback to summary
private int line
maxNextCharIndback to summary
private int maxNextCharInd
nextCharBufback to summary
private char[] nextCharBuf
nextCharIndback to summary
private int nextCharInd
prevCharIsCRback to summary
private boolean prevCharIsCR
prevCharIsLFback to summary
private boolean prevCharIsLF
staticFlagback to summary
public static final boolean staticFlag
tokenBeginback to summary
pack-priv int tokenBegin

Constructor Detail

UCode_CharStreamback to summary
public UCode_CharStream(Reader dstream, int startline, int startcolumn, int buffersize)
UCode_CharStreamback to summary
public UCode_CharStream(Reader dstream, int startline, int startcolumn)
UCode_CharStreamback to summary
public UCode_CharStream(InputStream dstream, int startline, int startcolumn, int buffersize)
UCode_CharStreamback to summary
public UCode_CharStream(InputStream dstream, int startline, int startcolumn)

Method Detail

adjustBeginLineColumnback to summary
public void adjustBeginLineColumn(int newLine, int newCol)

Method to adjust line and column numbers for the start of a token.

backupback to summary
public final void backup(int amount)

Implements org.apache.derby.impl.sql.compile.CharStream.backup.

Doc from org.apache.derby.impl.sql.compile.CharStream.backup.

Backs up the input stream by amount steps. Lexer calls this method if it had already read some characters, but could not use them to match a (longer) token. So, they will be used again as the prefix of the next token and it is the implemetation's responsibility to do this right.

BeginTokenback to summary
public char BeginToken() throws IOException

Implements org.apache.derby.impl.sql.compile.CharStream.BeginToken.

Doc from org.apache.derby.impl.sql.compile.CharStream.BeginToken.

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.

Doneback to summary
public void Done()

Implements org.apache.derby.impl.sql.compile.CharStream.Done.

Doc from org.apache.derby.impl.sql.compile.CharStream.Done.

The lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class. Again, the body of this function can be just empty and it will not affect the lexer's operation.

ExpandBuffback to summary
private void ExpandBuff(boolean wrapAround)
FillBuffback to summary
private void FillBuff() throws IOException
getBeginColumnback to summary
public final int getBeginColumn()

Implements org.apache.derby.impl.sql.compile.CharStream.getBeginColumn.

Doc from org.apache.derby.impl.sql.compile.CharStream.getBeginColumn.

Returns the column number of the first character for current token (being matched after the last call to BeginTOken).

getBeginLineback to summary
public final int getBeginLine()

Implements org.apache.derby.impl.sql.compile.CharStream.getBeginLine.

Doc from org.apache.derby.impl.sql.compile.CharStream.getBeginLine.

Returns the line number of the first character for current token (being matched after the last call to BeginTOken).

getBeginOffsetback to summary
public final int getBeginOffset()

Implements org.apache.derby.impl.sql.compile.CharStream.getBeginOffset.

getColumnback to summary
public final int getColumn()

Implements org.apache.derby.impl.sql.compile.CharStream.getColumn.

Doc from org.apache.derby.impl.sql.compile.CharStream.getColumn.

Deprecated

Returns the column position of the character last read.

Annotations
@Deprecated
See Also
getEndColumn
getEndColumnback to summary
public final int getEndColumn()

Implements org.apache.derby.impl.sql.compile.CharStream.getEndColumn.

Doc from org.apache.derby.impl.sql.compile.CharStream.getEndColumn.

Returns the column number of the last character for current token (being matched after the last call to BeginTOken).

getEndLineback to summary
public final int getEndLine()

Implements org.apache.derby.impl.sql.compile.CharStream.getEndLine.

Doc from org.apache.derby.impl.sql.compile.CharStream.getEndLine.

Returns the line number of the last character for current token (being matched after the last call to BeginTOken).

getEndOffsetback to summary
public final int getEndOffset()

Implements org.apache.derby.impl.sql.compile.CharStream.getEndOffset.

GetImageback to summary
public final String GetImage()

Implements org.apache.derby.impl.sql.compile.CharStream.GetImage.

Doc from org.apache.derby.impl.sql.compile.CharStream.GetImage.

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.

getLineback to summary
public final int getLine()

Implements org.apache.derby.impl.sql.compile.CharStream.getLine.

Doc from org.apache.derby.impl.sql.compile.CharStream.getLine.

Deprecated

Returns the line number of the character last read.

Annotations
@Deprecated
See Also
getEndLine
GetSuffixback to summary
public final char[] GetSuffix(int len)

Implements org.apache.derby.impl.sql.compile.CharStream.GetSuffix.

Doc from org.apache.derby.impl.sql.compile.CharStream.GetSuffix.

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(); }

ReadCharback to summary
private char ReadChar() throws IOException
readCharback to summary
public final char readChar() throws IOException

Implements org.apache.derby.impl.sql.compile.CharStream.readChar.

Doc from org.apache.derby.impl.sql.compile.CharStream.readChar.

Returns the next character from the selected input. The method of selecting the input is the responsibility of the class implementing this interface. Can throw any java.io.IOException.

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

Implements org.apache.derby.impl.sql.compile.CharStream.ReInit.

ReInitback to summary
public void ReInit(Reader dstream, int startline, int startcolumn)

Implements org.apache.derby.impl.sql.compile.CharStream.ReInit.

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

Implements org.apache.derby.impl.sql.compile.CharStream.ReInit.

ReInitback to summary
public void ReInit(InputStream dstream, int startline, int startcolumn)

Implements org.apache.derby.impl.sql.compile.CharStream.ReInit.

UpdateLineColumnback to summary
private void UpdateLineColumn(char c)