Ejemplo n.º 1
0
 @Override
 public Expr copy(final QueryContext qc, final VarScope scp, final IntObjMap<Var> vs) {
   final Var v = scp.addCopy(var, qc);
   vs.put(var.id, v);
   final Spec spec = new Spec(info, v, expr.copy(qc, scp, vs), coll);
   spec.occluded = occluded;
   return spec;
 }
Ejemplo n.º 2
0
 @Override
 public Expr copy(final QueryContext ctx, final VarScope o, final IntObjMap<Var> vs) {
   final VarScope scp = new VarScope();
   final Var[] arg = new Var[args.length];
   for (int i = 0; i < arg.length; i++) vs.put(args[i].id, arg[i] = scp.newCopyOf(ctx, args[i]));
   final Expr call = expr.copy(ctx, scp, vs);
   return new FuncLit(name, arg, call, (FuncType) type.type, scp, sc, info);
 }
Ejemplo n.º 3
0
  @Override
  public GroupBy copy(final QueryContext qc, final VarScope scp, final IntObjMap<Var> vs) {
    // copy the pre-grouping expressions
    final Expr[] pEx = Arr.copyAll(qc, scp, vs, preExpr);

    // create fresh copies of the post-grouping variables
    final Var[] ps = new Var[post.length];
    final int pl = ps.length;
    for (int p = 0; p < pl; p++) {
      final Var old = post[p];
      ps[p] = scp.addCopy(old, qc);
      vs.put(old.id, ps[p]);
    }

    // done
    return new GroupBy(Arr.copyAll(qc, scp, vs, specs), pEx, ps, nonOcc, info);
  }
Ejemplo n.º 4
0
 @Override
 public Count copy(final QueryContext qc, final VarScope scp, final IntObjMap<Var> vs) {
   final Var v = scp.newCopyOf(qc, var);
   vs.put(var.id, v);
   return new Count(v, info);
 }