From 16d37eb6dd078f88c12963f8f3d1e796f133ca4c Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 11 Jan 2006 02:04:14 -0500 Subject: [PATCH] checkpoint harmony darcs-hash:20060111070414-5007d-3bde4a25baf840475e966edc71709023ca32745b.gz --- src/edu/berkeley/sbp/GSS.java | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/edu/berkeley/sbp/GSS.java b/src/edu/berkeley/sbp/GSS.java index b98d077..7fefafc 100644 --- a/src/edu/berkeley/sbp/GSS.java +++ b/src/edu/berkeley/sbp/GSS.java @@ -17,11 +17,9 @@ class GSS { public int resets = 0; public int waits = 0; - HashMapBag inhibited = new HashMapBag(); - HashMapBag assumed = new HashMapBag(); + HashMapBag inhibited = new HashMapBag(); HashMapBag waiting = new HashMapBag(); - HashMapBag performed = new HashMapBag(); - HashSet tail = new HashSet(); + HashMapBag performed = new HashMapBag(); /** corresponds to a positions between tokens the input stream; same as Tomita's U_i's */ public class Phase implements Invokable, IntegerMappable { @@ -62,12 +60,10 @@ class GSS { this.token = token; this.location = location; inhibited.clear(); - assumed.clear(); reset(); } public void reset() { - tail.clear(); waiting.clear(); performed.clear(); hash = new IntPairMap(); @@ -83,7 +79,6 @@ class GSS { if (n.touched) return; n.touched = true; for(Position p : n.state) { - //if (!p.isLast()) { if (((p.isFirst() || p.isLast()) && !force) || p.owner().name==null) { for(Node n2 : n.parents()) complain(n2, errors, force | p.isFirst()); @@ -92,17 +87,6 @@ class GSS { HashSet hs = errors.get(seqname); if (hs==null) errors.put(seqname, hs = new HashSet()); hs.add(p.element()+""); - //String s = " while parsing " + seqname + ": expected a " + p.element(); - //"\n"; - /* - s += " parsed: "; - for(Position p2 = p.owner().firstp(); p2 != null && p2 != p && !p2.isLast(); p2 = p2.next()) s += (p2.element() + " "); - s += "\n"; - s += " expected: "; - for(Position p2 = p; p2 != null && !p2.isLast(); p2 = p2.next()) s += (p2.element() + " "); - */ - //s += "\n"; - //errors.add(s); } } } @@ -181,12 +165,6 @@ class GSS { Sequence owner = reduction==null ? null : reduction.position.owner(); if (reduction!=null) { if (inhibited.contains(pos, owner)) return; - /* - if (assumed.contains(pos, owner)) { - tail.add(new Waiting(parent, pending, state, fromEmptyReduction, reduction)); - return; - } - */ if (owner.needs != null) for(Sequence s : owner.needs) if (!performed.contains(pos, s)) { @@ -228,7 +206,7 @@ class GSS { if (token != null && state.canShift(token)) break; if (state.isAccepting()) break; if (token==null) break; - //if (!state.canReduce(token)) return false; + if (!state.canReduce(token)) return false; //if (count > 1) break; //if (r.numPop == 0) break; //r.reduce(pending, parent, null, Phase.this, null); @@ -257,7 +235,6 @@ class GSS { //System.out.println("\nresetting due to " + r.position.owner() + " killing " + seq); //inhibited.clear(); inhibited.add(p, seq); - //assumed = inhibited; //inhibited = new HashMapBag(); reset = true; resets++; @@ -285,8 +262,6 @@ class GSS { reducing_list[i] = null; n.queueReductions(); } - //for(Waiting w : tail) - //w.perform(); } catch (Reset r) { reset(); reduce(); -- 1.7.10.4