use of io.shardingjdbc.core.parsing.lexer.token.Symbol in project sharding-jdbc by shardingjdbc.
the class Tokenizer method scanSymbol.
/**
* scan symbol.
*
* @return symbol token
*/
public Token scanSymbol() {
int length = 0;
while (CharType.isSymbol(charAt(offset + length))) {
length++;
}
String literals = input.substring(offset, offset + length);
Symbol symbol;
while (null == (symbol = Symbol.literalsOf(literals))) {
literals = input.substring(offset, offset + --length);
}
return new Token(symbol, literals, offset + length);
}