+ public void reduce(Reduction r, int pos, GSS.Phase target, Forest[] holder) {
+ Forest old = holder[pos];
+ holder[pos] = this.pending();
+ if (pos==0) {
+ System.arraycopy(holder, 0, r.position.holder, 0, holder.length);
+ for(int i=0; i<r.position.pos; i++) if (r.position.holder[i]==null) throw new Error("realbad");
+ Forest rex = r.position.rewrite(target.getLocation());
+ for(GSS.Phase.Node child : this.parents()) child.finish(r, rex, target, holder);
+ } else {
+ for(GSS.Phase.Node child : this.parents()) child.reduce(r, pos-1, target, holder);
+ }
+ holder[pos] = old;
+ }
+