public class SqlTokenStream extends java.lang.Object implements TokenStream<com.rabbitmq.jms.parse.sql.SqlToken,java.lang.Integer>
Apart from the TokenStream operations this implementation also supports a getResidue()
method, which returns the character sequence remaining after lexical scanning. If this is not empty,
the tokeniser failed to completely scan the input.
| Constructor and Description |
|---|
SqlTokenStream(java.lang.CharSequence cseq)
The constructor builds the whole token stream from the given character sequence by tokenising it.
|
| Modifier and Type | Method and Description |
|---|---|
com.rabbitmq.jms.parse.sql.SqlToken |
getNext()
Increment position in the stream; no-op if already at the end.
|
java.lang.CharSequence |
getResidue()
After this object is instantiated there may be characters in the initial sequence
which were not able to be tokenized.
|
boolean |
moreTokens() |
java.lang.Integer |
position() |
com.rabbitmq.jms.parse.sql.SqlToken |
readToken()
Reads token at the current position and the position is not changed.
|
void |
reset()
Reset the stream to the start.
|
void |
reset(java.lang.Integer position)
Reset the stream to the position provided, if it is a valid position.
|
void |
stepBack()
Decrement position in the stream; no-op if already at the beginning.
|
public SqlTokenStream(java.lang.CharSequence cseq)
SqlTokenType enum type.
This never fails with an exception, but may not consume many (or any) characters from cseq
and return most of the original sequence in getResidue().
cseq - - the sequence of characters (for example a String) which is tokenizedSqlTokenType,
tokenize(CharSequence)public java.lang.CharSequence getResidue()
public boolean moreTokens()
moreTokens in interface TokenStream<com.rabbitmq.jms.parse.sql.SqlToken,java.lang.Integer>public com.rabbitmq.jms.parse.sql.SqlToken readToken()
TokenStreamreadToken in interface TokenStream<com.rabbitmq.jms.parse.sql.SqlToken,java.lang.Integer>Token in the stream if any, otherwise nullpublic com.rabbitmq.jms.parse.sql.SqlToken getNext()
TokenStreamgetNext in interface TokenStream<com.rabbitmq.jms.parse.sql.SqlToken,java.lang.Integer>Token in the stream if any, otherwise nullpublic java.lang.Integer position()
position in interface TokenStream<com.rabbitmq.jms.parse.sql.SqlToken,java.lang.Integer>public void stepBack()
TokenStreamstepBack in interface TokenStream<com.rabbitmq.jms.parse.sql.SqlToken,java.lang.Integer>public void reset(java.lang.Integer position)
TokenStreamreset in interface TokenStream<com.rabbitmq.jms.parse.sql.SqlToken,java.lang.Integer>position - - previously returned place in the streampublic void reset()
TokenStreamtokenStream.reset(START) where Position START = tokenStream.getPosition();
was executed first after instantiation of the TokenStream.reset in interface TokenStream<com.rabbitmq.jms.parse.sql.SqlToken,java.lang.Integer>Copyright © 2022. All rights reserved.