- if (pos >=0) {
- if (onlychild != null)
- reduce(onlychild, pos-1, rex, null, target);
- else
- for(GSS.Phase.Node child : parent.parents())
- reduce(child, pos-1, rex, null, target);
+ }
+
+ // FIXME: this could be more elegant and/or cleaner and/or somewhere else
+ private void reduce(GSS.Phase.Node parent, int pos, GSS.Phase target) {
+ holder[pos] = parent.pending();
+ if (pos==0) {
+ System.arraycopy(holder, 0, position.holder, 0, holder.length);
+ Forest rex = position.rewrite(target.getLocation());
+ for(GSS.Phase.Node child : parent.parents()) finish(child, rex, target);