return true;
}
+ LinkedList<Node> reductionQueue = new LinkedList<Node>();
+
/** perform all reduction operations */
public void reduce() throws ParseFailed {
try {
// INVARIANT: we never "see" a node until its parent-set is complete, modulo merges
}
for(int i=0; i<num; i++) {
- Node n = reducing_list[i];
+ reductionQueue.add(reducing_list[i]);
reducing_list[i] = null;
- n.performReductions();
+ }
+ while(!reductionQueue.isEmpty()) {
+ reductionQueue.remove().performReductions();
}
if (reset) {
reset = false;
/** a node in the GSS */
final class Node implements Invokable<Position, Node, Node>, IntegerMappable, GraphViz.ToGraphViz {
public FastSet<Node> set = new FastSet<Node>();
-
-
private boolean allqueued = false;
/** what state this node is in */
}
public void performReductions(Node n2) {
- if (!allqueued) performReductions();
+ if (!allqueued) reductionQueue.add(this);//performReductions();
else state.invokeReductions(token, this, this, n2);
}