From 4519f5ec820b1e704dba2df8727bd41b3384c49d Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 11 Jan 2006 02:21:52 -0500 Subject: [PATCH] checkpoint harmony darcs-hash:20060111072152-5007d-287366b8b751a357b3c8a487c14013af2bdb86bc.gz --- src/edu/berkeley/sbp/GSS.java | 21 +++++++++------------ src/edu/berkeley/sbp/ParseFailed.java | 4 ++-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/edu/berkeley/sbp/GSS.java b/src/edu/berkeley/sbp/GSS.java index d2b040d..8c7b2db 100644 --- a/src/edu/berkeley/sbp/GSS.java +++ b/src/edu/berkeley/sbp/GSS.java @@ -125,7 +125,7 @@ class GSS { 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) { @@ -141,8 +141,10 @@ class GSS { } 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; } @@ -247,12 +249,11 @@ class GSS { } } - // GSS Nodes ////////////////////////////////////////////////////////////////////////////// + // Node ///////////////////////////////////////////////////////////////////////////////// /** a node in the GSS */ public final class Node extends FastSet implements Invokable { - public boolean touched = false; private Forest.Ref holder = null; private boolean allqueued = false; @@ -260,8 +261,7 @@ class GSS { 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 parents() { return this; } @@ -270,7 +270,6 @@ class GSS { if (!reducing) return; if (allqueued) return; allqueued = true; - int where = parents().size(); state.invokeReductions(token, this, this, null); } @@ -282,10 +281,8 @@ class GSS { 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() { diff --git a/src/edu/berkeley/sbp/ParseFailed.java b/src/edu/berkeley/sbp/ParseFailed.java index 9a7012f..e5041d6 100644 --- a/src/edu/berkeley/sbp/ParseFailed.java +++ b/src/edu/berkeley/sbp/ParseFailed.java @@ -17,8 +17,8 @@ public class ParseFailed extends RuntimeException { public String toString() { return message/* + (location==null ? "" : (" at " + location))*/; } public static void complain(Node n, HashMap> errors, boolean force) { - if (n.touched) return; - n.touched = true; + //if (n.touched) return; + //n.touched = true; for(Position p : n.state) { if (((p.isFirst() || p.isLast()) && !force) || p.owner().name==null) { for(Node n2 : n.parents()) -- 1.7.10.4