예제 #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;
 }
예제 #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;
    }
  }
예제 #3
0
파일: Path.java 프로젝트: runeengh/basex
 @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);
 }
예제 #4
0
파일: Preds.java 프로젝트: dirkk/basex
 @Override
 public boolean removable(final Var var) {
   for (final Expr p : preds) if (p.uses(var)) return false;
   return true;
 }
예제 #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);
 }
예제 #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;
 }