X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FGSS.java;h=27eb279a16692b92ad69a6c0dfd85d55bf172508;hp=7c1fb19f1e8bab3c2ac62ea828f7e5953790dca9;hb=80f8bc14a13b5e4912004e081ec96dc6ed807385;hpb=ffb2106e9497f12c4edb173ef561f9333da6f02c diff --git a/src/edu/berkeley/sbp/GSS.java b/src/edu/berkeley/sbp/GSS.java index 7c1fb19..27eb279 100644 --- a/src/edu/berkeley/sbp/GSS.java +++ b/src/edu/berkeley/sbp/GSS.java @@ -113,7 +113,7 @@ class GSS { public boolean isFrontier() { return hash!=null; } /** perform all shift operations, adding promoted nodes to next */ - private void shift(Phase next, Forest result) throws ParseFailed { + private void shift(Phase next, Forest f) throws ParseFailed { this.next = next; // this massively improves GC performance if (prev != null) { @@ -130,7 +130,9 @@ class GSS { finalResult.merge(r.getForest()); } if (token == null) continue; - n.state().invokeShifts(token, this, new Result(result, n, null)); + Result result = new Result(f, null, null); + result.addParent(n); + n.state().invokeShifts(token, this, result); } numNewNodes = next==null ? 0 : next.hash.size(); viewPos = this.pos; @@ -189,6 +191,7 @@ class GSS { if (!state.canReduce(token)) return false; } while(false); Node n = new Node(Phase.this, result, state, fromEmptyReduction); // ALLOC + /** FIXME: this null-result can be used to notice bogus/dead states */ for(Object s : state.conjunctStates) newNode(new Result(null, n, null), (State)s, fromEmptyReduction); return !n.state().doomed();