Example #1
0
 @Override
 public boolean uses(final Use u) {
   for (final Expr p : pred) {
     if (u == Use.POS && p.type().mayBeNum() || p.uses(u)) return true;
   }
   return false;
 }
Example #2
0
  /**
   * Tests if the specified expressions are updating or vacuous.
   *
   * @param ctx query context
   * @param expr expression array
   * @throws QueryException query exception
   */
  public void checkUp(final QueryContext ctx, final Expr... expr) throws QueryException {

    if (!ctx.updating) return;
    int s = 0;
    for (final Expr e : expr) {
      if (e.vacuous()) continue;
      final boolean u = e.uses(Use.UPD);
      if (u && s == 2 || !u && s == 1) UPNOT.thrw(input, desc());
      s = u ? 1 : 2;
    }
  }
Example #3
0
 @Override
 public final boolean removable(final Var var) {
   for (final Expr step : steps) if (step.uses(var)) return false;
   return root == null || root.removable(var);
 }
Example #4
0
 @Override
 public boolean removable(final Var var) {
   for (final Expr p : preds) if (p.uses(var)) return false;
   return true;
 }
Example #5
0
 @Override
 public boolean uses(final Use u) {
   if (u == Use.VAR) return true;
   for (final TypeCase c : cases) if (c.uses(u)) return true;
   return ts.uses(u);
 }
Example #6
0
 /**
  * Checks if the specified expressions is no updating expression.
  *
  * @param e expression
  * @param ctx query context
  * @return the specified expression
  * @throws QueryException query exception
  */
 public final Expr checkUp(final Expr e, final QueryContext ctx) throws QueryException {
   if (e != null && ctx.updating && e.uses(Use.UPD)) UPNOT.thrw(input, desc());
   return e;
 }