p.holder.merge(pending);
if (p.parents().contains(parent)) return true;
p.parents().add(parent, true);
- if (p!=parent && !fromEmptyReduction) p.queueReductions(parent);
+ if (p!=parent && !fromEmptyReduction && reducing) p.queueReductions(parent);
return true;
}
private boolean newNode3(Node parent, Forest pending, State state, boolean fromEmptyReduction) {
} while(false);
Node n = new Node(parent, pending, state, fromEmptyReduction); // ALLOC
- n.queueEmptyReductions();
- if (!fromEmptyReduction) n.queueReductions(parent);
+ if (reducing) {
+ n.queueEmptyReductions();
+ if (!fromEmptyReduction) n.queueReductions(parent);
+ }
return true;
}
}
}
- // GSS Nodes //////////////////////////////////////////////////////////////////////////////
+ // Node /////////////////////////////////////////////////////////////////////////////////
/** a node in the GSS */
public final class Node extends FastSet<Node> implements Invokable<Reduction, Node, Node> {
- public boolean touched = false;
private Forest.Ref holder = null;
private boolean allqueued = false;
public final State state;
/** which Phase this Node belongs to (node that Node is also a non-static inner class of Phase) */
- public Phase phase() { return Phase.this; }
-
+ public Phase phase() { return Phase.this; }
public Forest.Ref holder() { return holder==null ? (holder = new Forest.Ref()) : holder; }
public Forest pending() { return Phase.this.closed ? holder().resolve() : holder; }
public FastSet<Node> parents() { return this; }
if (!reducing) return;
if (allqueued) return;
allqueued = true;
- int where = parents().size();
state.invokeReductions(token, this, this, null);
}
public final void invoke(Reduction r, Node n, Node n2) {
if (n==null) {
if (r.position.pos==0) r.reduce(this);
- return;
- }
- if (r.position.pos==0) return;
- if (n2==null) r.reduce(n);
+ } else if (r.position.pos==0) return;
+ else if (n2==null) r.reduce(n);
else r.reduce(n, n2);
}
public void queueEmptyReductions() {