Examples of token()


Examples of com.alibaba.druid.sql.dialect.mysql.parser.MySqlLexer.token()

        lexer.nextToken();

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

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

        return expr;
    }
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.oracle.parser.OracleLexer.token()

    public void test_hint() throws Exception {
        String sql = "SELECT /*+FIRST_ROWS*/ * FROM T WHERE F1 = ? ORDER BY F2";
        OracleLexer lexer = new OracleLexer(sql);
        for (;;) {
            lexer.nextToken();
            Token tok = lexer.token();

            switch (tok) {
                case IDENTIFIER:
                    System.out.println(tok.name() + "\t\t" + lexer.stringVal());
                    break;
View Full Code Here

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

Examples of com.alibaba.fastjson.parser.JSONLexer.token()

        DefaultJSONParser parser = new DefaultJSONParser(text, ParserConfig.getGlobalInstance());

        JSONArray array;

        JSONLexer lexer = parser.getLexer();
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            array = null;
        } else if (lexer.token() == JSONToken.EOF) {
            array = null;
        } else {
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONLexer.token()

        JSONLexer lexer = parser.getLexer();
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            array = null;
        } else if (lexer.token() == JSONToken.EOF) {
            array = null;
        } else {
            array = new JSONArray();
            parser.parseArray(array);
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONLexer.token()

        List<T> list;

        DefaultJSONParser parser = new DefaultJSONParser(text, ParserConfig.getGlobalInstance());
        JSONLexer lexer = parser.getLexer();
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            list = null;
        } else {
            list = new ArrayList<T>();
            parser.parseArray(clazz, list);
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONLexer.token()

    public final static MapDeserializer instance = new MapDeserializer();

    @SuppressWarnings("unchecked")
    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        final JSONLexer lexer = parser.getLexer();
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken(JSONToken.COMMA);
            return null;
        }

        Map<Object, Object> map = createMap(type);
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONLexer.token()

        ParseContext context = parser.getContext();

        try {
            parser.setContext(context, map, fieldName);

            if (lexer.token() == JSONToken.RBRACE) {
                lexer.nextToken(JSONToken.COMMA);
                return (T) map;
            }

            return (T) deserialze(parser, type, fieldName, map);
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONLexer.token()

        DefaultJSONParser parser = new DefaultJSONParser(text, ParserConfig.getGlobalInstance());

        JSONArray array;

        JSONLexer lexer = parser.getLexer();
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            array = null;
        } else if (lexer.token() == JSONToken.EOF) {
            array = null;
        } else {
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONLexer.token()

        JSONLexer lexer = parser.getLexer();
        if (lexer.token() == JSONToken.NULL) {
            lexer.nextToken();
            array = null;
        } else if (lexer.token() == JSONToken.EOF) {
            array = null;
        } else {
            array = new JSONArray();
            parser.parseArray(array);
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.