projects
/
sbp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a60fa7d
)
abort if only remaining nodes are doomed
author
adam
<adam@megacz.com>
Fri, 20 Apr 2007 03:19:58 +0000
(23:19 -0400)
committer
adam
<adam@megacz.com>
Fri, 20 Apr 2007 03:19:58 +0000
(23:19 -0400)
darcs-hash:
20070420031958
-5007d-
bcba9daa363062ba4c756dd0b5f6231856322930
.gz
src/edu/berkeley/sbp/GSS.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/sbp/GSS.java
b/src/edu/berkeley/sbp/GSS.java
index
5c1b92f
..
3c6beac
100644
(file)
--- a/
src/edu/berkeley/sbp/GSS.java
+++ b/
src/edu/berkeley/sbp/GSS.java
@@
-185,7
+185,7
@@
class GSS {
*/
private boolean newNode(Result result, State state, boolean fromEmptyReduction) {
Node p = hash.get(state, result.phase());
*/
private boolean newNode(Result result, State state, boolean fromEmptyReduction) {
Node p = hash.get(state, result.phase());
- if (p != null) { p.addResult(result); return true; }
+ if (p != null) { p.addResult(result); return !state.doomed(); }
do {
if (token != null && state.canShift(token)) break;
if (state.isAccepting()) break;
do {
if (token != null && state.canShift(token)) break;
if (state.isAccepting()) break;
@@
-195,7
+195,7
@@
class GSS {
Node n = new Node(Phase.this, result, state, fromEmptyReduction); // ALLOC
for(Object s : state.conjunctStates)
newNode(new Result(null, n, null), (State)s, fromEmptyReduction);
Node n = new Node(Phase.this, result, state, fromEmptyReduction); // ALLOC
for(Object s : state.conjunctStates)
newNode(new Result(null, n, null), (State)s, fromEmptyReduction);
- return true;
+ return !n.state().doomed();
}
public int toInt() { return pos+1; }
}
public int toInt() { return pos+1; }