Search in sources :

Example 1 with Symbol

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);
}
Also used : Symbol(io.shardingjdbc.core.parsing.lexer.token.Symbol) Token(io.shardingjdbc.core.parsing.lexer.token.Token)

Aggregations

Symbol (io.shardingjdbc.core.parsing.lexer.token.Symbol)1 Token (io.shardingjdbc.core.parsing.lexer.token.Token)1