return zero = position.rewrite(null);
}
- // FIXME: this could be more elegant and/or cleaner and/or somewhere else
- public void reduce(GSS.Phase.Node parent, int pos, GSS.Phase target, Forest[] holder) {
- Forest old = holder[pos];
- holder[pos] = parent.pending();
- if (pos==0) {
- System.arraycopy(holder, 0, position.holder, 0, holder.length);
- for(int i=0; i<position.pos; i++) if (position.holder[i]==null) throw new Error("realbad");
- Forest rex = position.rewrite(target.getLocation());
- for(GSS.Phase.Node child : parent.parents()) child.finish(this, rex, target, holder);
- } else {
- for(GSS.Phase.Node child : parent.parents()) reduce(child, pos-1, target, holder);
- }
- holder[pos] = old;
- }
}
}