Package net.sf.jsqlparser.parser
Class SimpleCharStream
- java.lang.Object
-
- net.sf.jsqlparser.parser.SimpleCharStream
-
public class SimpleCharStream extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected int
absoluteTokenBegin
(package private) int
available
protected int[]
bufcolumn
protected char[]
buffer
protected int[]
bufline
int
bufpos
Position in buffer.(package private) int
bufsize
protected int
column
protected int
inBuf
protected Provider
inputStream
private boolean
isStringProvider
protected int
line
protected int
maxNextCharInd
protected boolean
prevCharIsCR
protected boolean
prevCharIsLF
static boolean
staticFlag
Whether parser is static.protected int
tabSize
(package private) int
tokenBegin
protected int
totalCharsRead
protected boolean
trackLineColumn
-
Constructor Summary
Constructors Constructor Description SimpleCharStream(Provider dstream)
ConstructorSimpleCharStream(Provider dstream, int startline, int startcolumn)
ConstructorSimpleCharStream(Provider dstream, int startline, int startcolumn, int buffersize)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
adjustBeginLineColumn(int newLine, int newCol)
Method to adjust line and column numbers for the start of a token.void
backup(int amount)
Backup a number of characters.char
BeginToken()
Start.void
Done()
Reset buffer when finished.protected void
ExpandBuff(boolean wrapAround)
protected void
FillBuff()
int
getAbsoluteTokenBegin()
int
getBeginColumn()
int
getBeginLine()
int
getColumn()
Deprecated.int
getEndColumn()
int
getEndLine()
java.lang.String
GetImage()
int
getLine()
Deprecated.char[]
GetSuffix(int len)
int
getTabSize()
(package private) boolean
getTrackLineColumn()
char
readChar()
Read a character.private char
readChar(int pos)
void
ReInit(Provider dstream)
Reinitialise.void
ReInit(Provider dstream, int startline, int startcolumn)
Reinitialise.void
ReInit(Provider dstream, int startline, int startcolumn, int buffersize)
Reinitialise.void
setTabSize(int i)
(package private) void
setTrackLineColumn(boolean tlc)
protected void
UpdateLineColumn(char c)
-
-
-
Field Detail
-
staticFlag
public static final boolean staticFlag
Whether parser is static.- See Also:
- Constant Field Values
-
bufsize
int bufsize
-
available
int available
-
tokenBegin
int tokenBegin
-
bufpos
public int bufpos
Position in buffer.
-
bufline
protected int[] bufline
-
bufcolumn
protected int[] bufcolumn
-
column
protected int column
-
line
protected int line
-
prevCharIsCR
protected boolean prevCharIsCR
-
prevCharIsLF
protected boolean prevCharIsLF
-
inputStream
protected Provider inputStream
-
isStringProvider
private boolean isStringProvider
-
buffer
protected char[] buffer
-
maxNextCharInd
protected int maxNextCharInd
-
inBuf
protected int inBuf
-
tabSize
protected int tabSize
-
trackLineColumn
protected boolean trackLineColumn
-
totalCharsRead
protected int totalCharsRead
-
absoluteTokenBegin
protected int absoluteTokenBegin
-
-
Constructor Detail
-
SimpleCharStream
public SimpleCharStream(Provider dstream, int startline, int startcolumn, int buffersize)
Constructor- Parameters:
dstream
-startline
-startcolumn
-buffersize
-
-
SimpleCharStream
public SimpleCharStream(Provider dstream, int startline, int startcolumn)
Constructor- Parameters:
dstream
-startline
-startcolumn
-
-
SimpleCharStream
public SimpleCharStream(Provider dstream)
Constructor- Parameters:
dstream
-
-
-
Method Detail
-
setTabSize
public void setTabSize(int i)
-
getTabSize
public int getTabSize()
-
getAbsoluteTokenBegin
public final int getAbsoluteTokenBegin()
-
ExpandBuff
protected void ExpandBuff(boolean wrapAround) throws java.io.IOException
- Throws:
java.io.IOException
-
FillBuff
protected void FillBuff() throws java.io.IOException
- Throws:
java.io.IOException
-
BeginToken
public char BeginToken() throws java.io.IOException
Start.- Returns:
- the character read
- Throws:
java.io.IOException
-
UpdateLineColumn
protected void UpdateLineColumn(char c)
-
readChar
private char readChar(int pos)
-
readChar
public char readChar() throws java.io.IOException
Read a character.- Returns:
- the character read
- Throws:
java.io.IOException
-
getColumn
@Deprecated public int getColumn()
Deprecated.- Returns:
- the column
- See Also:
getEndColumn()
-
getLine
@Deprecated public int getLine()
Deprecated.- Returns:
- the line
- See Also:
getEndLine()
-
getEndColumn
public int getEndColumn()
- Returns:
- get token end column number.
-
getEndLine
public int getEndLine()
- Returns:
- get token end line number.
-
getBeginColumn
public int getBeginColumn()
- Returns:
- get token beginning column number.
-
getBeginLine
public int getBeginLine()
- Returns:
- get token beginning line number.
-
backup
public void backup(int amount)
Backup a number of characters.- Parameters:
amount
-
-
ReInit
public void ReInit(Provider dstream, int startline, int startcolumn, int buffersize)
Reinitialise.- Parameters:
dstream
-startline
-startcolumn
-buffersize
-
-
ReInit
public void ReInit(Provider dstream, int startline, int startcolumn)
Reinitialise.- Parameters:
dstream
-startline
-startcolumn
-
-
ReInit
public void ReInit(Provider dstream)
Reinitialise.- Parameters:
dstream
-
-
GetImage
public java.lang.String GetImage()
- Returns:
- get token literal value.
-
GetSuffix
public char[] GetSuffix(int len)
- Parameters:
len
-- Returns:
- get the suffix.
-
Done
public void Done()
Reset buffer when finished.
-
adjustBeginLineColumn
public void adjustBeginLineColumn(int newLine, int newCol)
Method to adjust line and column numbers for the start of a token.- Parameters:
newLine
-newCol
-
-
getTrackLineColumn
boolean getTrackLineColumn()
-
setTrackLineColumn
void setTrackLineColumn(boolean tlc)
-
-