Package com.alibaba.druid.sql.parser

Examples of com.alibaba.druid.sql.parser.Lexer.token()


    String sql = "SELECT * FROM T WHERE F1 = ? ORDER BY F2";
    Lexer lexer = new Lexer(sql);
    System.out.println("--------------------------------------------");
    for (;;) {
      lexer.nextToken();
      Token tok = lexer.token();

      if (tok == Token.IDENTIFIER) {
        System.out.println(tok.name() + "\t\t" + lexer.stringVal());
      } else {
        System.out.println(tok.name() + "\t\t\t" + tok.name);
View Full Code Here


        lexer.nextToken();

        SQLExprParser parser = new SQLExprParser(lexer);
        SQLExpr expr = parser.expr();

        if (lexer.token() != Token.EOF) {
            throw new ParserException("illegal sql expr : " + sql);
        }

        return expr;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.