Examples of ParserException


Examples of cc.redberry.core.parser.ParserException

                        descriptor.getSymmetries().add(b, false, 1, 0);
                        return descriptor;
                    }
                } else {
                    if (sname.equals(kroneckerAndMetricNames[1]))
                        throw new ParserException("Metric is not specified for non metric index type.");
                    if (sname.equals(kroneckerAndMetricNames[0])) {
                        if (its.getTypeData(b).states.get(0) != true || its.getTypeData(b).states.get(1) != false)
                            throw new ParserException("Illegal Kroneckers indices states.");
                        NameDescriptor descriptor = new NameDescriptorForMetricAndKronecker(kroneckerAndMetricNames, b, id);
                        return descriptor;
                    }
                }
            }
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

          accept(Token.COMMA);
          clause.setPartitionCount(this.exprParser.expr());
          accept(Token.RPAREN);
          stmt.setPartitioning(clause);
        } else {
          throw new ParserException("TODO " + lexer.token() + " "
              + lexer.stringVal());
        }
      }

      if (!(lexer.token() == (Token.COMMA))) {
        break;
      } else {
        lexer.nextToken();
      }

    }
    if (lexer.token() == (Token.ON)) {
      throw new ParserException("TODO");
    }

    if (lexer.token() == (Token.SELECT)) {
      SQLSelect query = new MySqlSelectParser(this.exprParser).select();
      stmt.setQuery(query);
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

      column.setColumnConstraint(FieldKeyWord.OPTIONAL);
    } else if (name.getSimleName().equalsIgnoreCase(
        WaspSqlCreateTableParser.REPEATED)) {
      column.setColumnConstraint(FieldKeyWord.REPEATED);
    } else {
      throw new ParserException("error " + name);
    }
    column.setDataType(parseDataType());
    column.setName(name());
    return parseColumnRest(column);
  }
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

      column.setComment(name().getSimleName());
      return parseColumnRest(column);
    }

    if (identifierEquals("PARTITION")) {
      throw new ParserException("syntax error " + lexer.token() + " "
          + lexer.stringVal());
    }

    super.parseColumnRest(column);
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

    }

    if (identifierEquals(USER)) {
      return parseCreateUser();
    }
    throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
  }
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

        lexer.nextToken();
      } else if (identifierEquals("HASH")) {
        stmt.setUsing("HASH");
        lexer.nextToken();
      } else {
        throw new ParserException("TODO " + lexer.token() + " "
            + lexer.stringVal());
      }
    } else if (identifierEquals("STORING")) {
      lexer.nextToken();
      accept(Token.LPAREN);
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

      lexer.nextToken();
    } else if (identifierEquals("QUERY")) {
      stmt.setType(WaspSqlKillStatement.Type.QUERY);
      lexer.nextToken();
    } else {
      throw new ParserException("not support kill type " + lexer.token());
    }
    SQLExpr threadId = this.exprParser.expr();
    stmt.setThreadId(threadId);
    return stmt;
  }
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

  public WaspSqlDescribeStatement parseDescribe() {
    if (lexer.token() == Token.DESC || identifierEquals(DESCRIBE)) {
      lexer.nextToken();
    } else {
      throw new ParserException("expect DESC, actual " + lexer.token());
    }

    WaspSqlDescribeStatement stmt = new WaspSqlDescribeStatement();
    stmt.setObject(this.exprParser.name());
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

        lexer.nextToken();
        WaspSqlShowCreateTableStatement stmt = new WaspSqlShowCreateTableStatement();
        stmt.setName(this.exprParser.name());
        return stmt;
      }
      throw new ParserException("TODO " + lexer.stringVal());
    }
    if (identifierEquals("GRANTS")) {
      lexer.nextToken();
      WaspSqlShowGrantsStatement stmt = new WaspSqlShowGrantsStatement();
      if (lexer.token() == Token.FOR) {
        lexer.nextToken();
        stmt.setUser(this.exprParser.expr());
      }
      return stmt;
    }
    if (lexer.token() == Token.INDEX || identifierEquals("INDEXES")) {
      lexer.nextToken();
      WaspSqlShowIndexesStatement stmt = new WaspSqlShowIndexesStatement();
      if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
        lexer.nextToken();
        SQLName table = exprParser.name();
        stmt.setTable(table);
        if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
          lexer.nextToken();
          SQLName database = exprParser.name();
          stmt.setDatabase(database);
        }
      }
      return stmt;
    }
    if (identifierEquals("OPEN")) {
      lexer.nextToken();
      acceptIdentifier(TABLES);
      WaspSqlShowOpenTablesStatement stmt = new WaspSqlShowOpenTablesStatement();
      if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
        lexer.nextToken();
        stmt.setDatabase(this.exprParser.name());
      }
      if (lexer.token() == Token.LIKE) {
        lexer.nextToken();
        stmt.setLike(this.exprParser.expr());
      }
      if (lexer.token() == Token.WHERE) {
        lexer.nextToken();
        stmt.setWhere(this.exprParser.expr());
      }
      return stmt;
    }
    if (identifierEquals("PROFILES")) {
      lexer.nextToken();
      WaspSqlShowProfilesStatement stmt = new WaspSqlShowProfilesStatement();
      return stmt;
    }

    if (identifierEquals("PROFILE")) {
      lexer.nextToken();
      WaspSqlShowProfileStatement stmt = new WaspSqlShowProfileStatement();
      for (;;) {
        if (lexer.token() == Token.ALL) {
          stmt.getTypes().add(WaspSqlShowProfileStatement.Type.ALL);
          lexer.nextToken();
        } else if (identifierEquals("BLOCK")) {
          lexer.nextToken();
          acceptIdentifier("IO");
          stmt.getTypes().add(WaspSqlShowProfileStatement.Type.BLOCK_IO);
        } else if (identifierEquals("CONTEXT")) {
          lexer.nextToken();
          acceptIdentifier("SWITCHES");
          stmt.getTypes()
              .add(WaspSqlShowProfileStatement.Type.CONTEXT_SWITCHES);
        } else if (identifierEquals("CPU")) {
          lexer.nextToken();
          stmt.getTypes().add(WaspSqlShowProfileStatement.Type.CPU);
        } else if (identifierEquals("IPC")) {
          lexer.nextToken();
          stmt.getTypes().add(WaspSqlShowProfileStatement.Type.IPC);
        } else if (identifierEquals("MEMORY")) {
          lexer.nextToken();
          stmt.getTypes().add(WaspSqlShowProfileStatement.Type.MEMORY);
        } else if (identifierEquals("PAGE")) {
          lexer.nextToken();
          acceptIdentifier("FAULTS");
          stmt.getTypes().add(WaspSqlShowProfileStatement.Type.PAGE_FAULTS);
        } else if (identifierEquals("SOURCE")) {
          lexer.nextToken();
          stmt.getTypes().add(WaspSqlShowProfileStatement.Type.SOURCE);
        } else if (identifierEquals("SWAPS")) {
          lexer.nextToken();
          stmt.getTypes().add(WaspSqlShowProfileStatement.Type.SWAPS);
        } else {
          break;
        }

        if (lexer.token() == Token.COMMA) {
          lexer.nextToken();
          continue;
        }
        break;
      }

      if (lexer.token() == Token.FOR) {
        lexer.nextToken();
        acceptIdentifier("QUERY");
        stmt.setForQuery(this.exprParser.primary());
      }

      stmt.setLimit(this.parseLimit());

      return stmt;
    }
    if (lexer.token() == Token.TABLE) {
      lexer.nextToken();
      acceptIdentifier(STATUS);
      WaspSqlShowTableStatusStatement stmt = new WaspSqlShowTableStatusStatement();
      if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
        lexer.nextToken();
        stmt.setDatabase(this.exprParser.name());
      }
      if (lexer.token() == Token.LIKE) {
        lexer.nextToken();
        stmt.setLike(this.exprParser.expr());
      }
      if (lexer.token() == Token.WHERE) {
        lexer.nextToken();
        stmt.setWhere(this.exprParser.expr());
      }
      return stmt;
    }
    throw new ParserException("TODO " + lexer.stringVal());
  }
View Full Code Here

Examples of com.alibaba.druid.sql.parser.ParserException

    }
    if (identifierEquals("XML")) {
      SQLStatement stmt = parseLoadXml();
      return stmt;
    }
    throw new ParserException("TODO");
  }
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.