⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mysqlparser.java

📁 mysql集群
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
      throw new ParseException();
    }
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 128:
      jj_consume_token(128);
      PropertySetQuery(statment);
      break;
    default:
      jj_la1[11] = jj_gen;
      ;
    }
                if(value != null){
                        ConstantExpression consExp= new ConstantExpression(value);
                        statment.addProperty(propertyName,consExp);
                }
                {if (true) return statment;}
    throw new Error("Missing return statement in function");
  }

  final public Statment UpdateQuery() throws ParseException {
        Expression expression = null;
        Table table = null;
        DMLStatment statment = null;
    table = UpdateStatement();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_WHERE:
      expression = WhereClause();
      break;
    default:
      jj_la1[12] = jj_gen;
      ;
    }
        statment = new UpdateStatment();
        statment.setExpression(expression);
        {if (true) return statment;}
    throw new Error("Missing return statement in function");
  }

  final public Table UpdateStatement() throws ParseException {
        Table table = null;
    jj_consume_token(K_UPDATE);
    table = TableReference();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 128:
      jj_consume_token(128);
      TableReference();
      break;
    default:
      jj_la1[13] = jj_gen;
      ;
    }
    jj_consume_token(K_SET);
    AssignmentClause();
        {if (true) return table;}
    throw new Error("Missing return statement in function");
  }

  final public Expression AssignmentClause() throws ParseException {
        Expression expression = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case IDENTIFIER:
    case S_QUOTED_IDENTIFIER:
    case S_COMMA_IDENTIFIER:
      expression = ColumnValues();

      break;
    case 129:
      jj_consume_token(129);
      UpdateColumn();
      label_1:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case 128:
          ;
          break;
        default:
          jj_la1[14] = jj_gen;
          break label_1;
        }
        jj_consume_token(128);
        UpdateColumn();
      }
      jj_consume_token(130);
      jj_consume_token(127);
      jj_consume_token(129);
      if (jj_2_1(2)) {
        UpdateValues();
      } else {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case K_SELECT:
        case 129:
          FullSelectStatement();
          break;
        default:
          jj_la1[15] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      jj_consume_token(130);
      break;
    default:
      jj_la1[16] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
                {if (true) return expression;}
    throw new Error("Missing return statement in function");
  }

  final public void UpdateColumn() throws ParseException {
    ColumnName();
  }

  final public List<Expression> UpdateValues() throws ParseException {
        Expression expression = null;
        List<Expression> list = new ArrayList<Expression>();
    expression = UpdateValue();
                                 list.add(expression);
    label_2:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 128:
        ;
        break;
      default:
        jj_la1[17] = jj_gen;
        break label_2;
      }
      jj_consume_token(128);
      expression = UpdateValue();
                                                                                      list.add(expression);
    }
        {if (true) return list;}
    throw new Error("Missing return statement in function");
  }

  final public Expression UpdateValue() throws ParseException {
Expression expression = null;
    expression = SQLSimpleExpression();
       {if (true) return   expression;}
    throw new Error("Missing return statement in function");
  }

  final public Statment DeleteQuery() throws ParseException {
        Expression expression = null;
        Table table = null;
        DMLStatment statment = null;
    table = DeleteStatement();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_WHERE:
      expression = WhereClause();
      break;
    default:
      jj_la1[18] = jj_gen;
      ;
    }
        statment = new DeleteStatment();
        statment.setExpression(expression);
        {if (true) return  statment;}
    throw new Error("Missing return statement in function");
  }

  final public Table DeleteStatement() throws ParseException {
        Table table = null;
    jj_consume_token(K_DELETE);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_FROM:
      jj_consume_token(K_FROM);
      break;
    default:
      jj_la1[19] = jj_gen;
      ;
    }
    table = TableReference();
        {if (true) return table;}
    throw new Error("Missing return statement in function");
  }

  final public Statment InsertQuery() throws ParseException {
        Table table = null;
        DMLStatment statment = new InsertStatment();
        Expression expression = null;
        List<Column> insertColumns = null;
        List<Expression> insertValues = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_INSERT:
      jj_consume_token(K_INSERT);
      break;
    case K_REPLACE:
      jj_consume_token(K_REPLACE);
      break;
    default:
      jj_la1[20] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_INTO:
      jj_consume_token(K_INTO);
      break;
    default:
      jj_la1[21] = jj_gen;
      ;
    }
    table = TableName();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_SELECT:
    case K_VALUES:
    case 129:
      if (jj_2_2(4)) {
        jj_consume_token(129);
        insertColumns = InsertColumns();
        jj_consume_token(130);
      } else {
        ;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case K_VALUES:
        insertValues = InsertValues();
        break;
      case K_SELECT:
      case 129:
        expression = FullSelectStatement();
        break;
      default:
        jj_la1[22] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
        if(insertValues == null){
                statment.setExpression(expression);
        }else{
                if(insertColumns != null){
                        AndExpression andExpression = new AndExpression();
                        int index = 0;
                        for(Column column:insertColumns){
                                ColumnExpression colExpression = new ColumnExpression();
                                colExpression.setColumn(column);
                                ComparisonExpression compExp = new ComparisonExpression();
                                compExp.setComparison(Comparative.Equivalent);
                                compExp.setExpression(insertValues.get(index));
                                colExpression.setExpression(compExp);
                                andExpression.addExpression(colExpression);
                                index ++;
                        }
                        statment.setExpression(andExpression);
                }
        }
      break;
    case K_SET:
      jj_consume_token(K_SET);
      expression = AssignmentClause();
                                              statment.setExpression(expression);
      break;
    default:
      jj_la1[23] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return statment;}
    throw new Error("Missing return statement in function");
  }

  final public List<Column> InsertColumns() throws ParseException {
        List<Column> insertColumns = new ArrayList<Column>();
        Column column = null;
    column = InsertColumn();
                                 insertColumns.add(column);
    label_3:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 128:
        ;
        break;
      default:
        jj_la1[24] = jj_gen;
        break label_3;
      }
      jj_consume_token(128);
      column = InsertColumn();
                                                                                          insertColumns.add(column);
    }
                {if (true) return insertColumns;}
    throw new Error("Missing return statement in function");
  }

//This is just a wrapper to provide different formatting in case of Insert
  final public Column InsertColumn() throws ParseException {
        Column column = null;
    column = ColumnName();
                {if (true) return column;}
    throw new Error("Missing return statement in function");
  }

  final public List<Expression> InsertValues() throws ParseException {
        List<Expression> insertValues = new ArrayList<Expression>();
        Expression expression = null;
    jj_consume_token(K_VALUES);
    jj_consume_token(129);
    expression = InsertValue();
                                                 insertValues.add(expression);
    label_4:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 128:
        ;
        break;
      default:
        jj_la1[25] = jj_gen;
        break label_4;
      }
      jj_consume_token(128);
      expression = InsertValue();
                                                                                                                insertValues.add(expression);
    }
    jj_consume_token(130);
        {if (true) return insertValues;}
    throw new Error("Missing return statement in function");
  }

//This is just a wrapper to provide different formatting in case of Insert
  final public Expression InsertValue() throws ParseException {
        Expression expression = null;
    expression = SQLSimpleExpression();
                {if (true) return expression;}
    throw new Error("Missing return statement in function");
  }

  final public Statment SelectQuery() throws ParseException {
        Expression expression = null;
        DMLStatment statment = null;
    expression = FullSelectStatement();
    label_5:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case K_FETCH:
      case K_FOR:
      case K_QUERYNO:
      case K_OPTIMIZE:
      case K_WITH:
        ;
        break;
      default:
        jj_la1[26] = jj_gen;
        break label_5;
      }
      ExtraClauses();
    }
        statment = new SelectStatment();
        statment.setExpression(expression);
        {if (true) return statment;}
    throw new Error("Missing return statement in function");
  }

  final public Expression ColumnValues() throws ParseException {
        Expression expression = null;
        AndExpression andExpression = new AndExpression();
    expression = ColumnValue();
                            if(expression != null) andExpression.addExpression(expression);
    label_6:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 128:
        ;
        break;
      default:
        jj_la1[27] = jj_gen;
        break label_6;
      }
      jj_consume_token(128);
      expression = ColumnValue();
                                                                                                                             if(expression != null) andExpression.addExpression(expression);
    }
  {if (true) return andExpression;}
    throw new Error("Missing return statement in function");
  }

  final public Expression ColumnValue() throws ParseException {
ColumnExpression colExpression = new ColumnExpression();
Expression expression = null;
Column column = null;
    column = ColumnName();
    jj_consume_token(127);
    expression = UpdatedValue();
        if(expression == null) {if (true) return null;}

        colExpression.setColumn(column);
        ComparisonExpression compExp = new ComparisonExpression();
                compExp.setComparison(Comparative.Equivalent);
                compExp.setExpression(expression);
                colExpression.setExpression(compExp);
        {if (true) return colExpression;}
    throw new Error("Missing return statement in function");
  }

  final public Expression UpdatedValue() throws ParseException {
Expression expression = null;
    if (jj_2_3(2147483647)) {
      jj_consume_token(129);
      expression = SubSelectStatement();
      jj_consume_token(130);
    } else if (jj_2_4(1)) {
      expression = SQLSimpleExpression();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return expression;}
    throw new Error("Missing return statement in function");
  }

  final public ComparisonExpression IsNullClause() throws ParseException {
        int comparison = Comparative.Equivalent;
    jj_consume_token(K_IS);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_NOT:
      jj_consume_token(K_NOT);
                     comparison = Comparative.NotEquivalent;
      break;
    default:
      jj_la1[28] = jj_gen;
      ;
    }
    jj_consume_token(K_NULL);
        ComparisonExpression comparativeExpression = new ComparisonExpression();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -