projects
/
sbp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
02d1ec4
)
checkpoint
author
adam
<adam@megacz.com>
Sun, 22 Jan 2006 09:21:33 +0000
(
04:21
-0500)
committer
adam
<adam@megacz.com>
Sun, 22 Jan 2006 09:21:33 +0000
(
04:21
-0500)
darcs-hash:
20060122092133
-5007d-
703adb8f3ae1e46db68a22df6feb05f452b0954c
.gz
src/edu/berkeley/sbp/Forest.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/sbp/Forest.java
b/src/edu/berkeley/sbp/Forest.java
index
df7a3ea
..
933515b
100644
(file)
--- a/
src/edu/berkeley/sbp/Forest.java
+++ b/
src/edu/berkeley/sbp/Forest.java
@@
-14,7
+14,11
@@
public abstract class Forest<T> /*extends PrintableTree<Forest.Body<T>>*/ implem
public ArrayList<Tree<T>> toks = new ArrayList<Tree<T>>();
public void invoke(Forest.Body<T> bod, Boolean toss, Integer i) {
if (i==null) {
public ArrayList<Tree<T>> toks = new ArrayList<Tree<T>>();
public void invoke(Forest.Body<T> bod, Boolean toss, Integer i) {
if (i==null) {
- addAll(bod.expand(toss, 0, new TreeMaker<T>()));
+ ArrayList<Tree<T>> toks = this.toks;
+ this.toks = new ArrayList<Tree<T>>();
+ //addAll(bod.expand(toss, 0, new TreeMaker<T>()));
+ bod.expand(toss, 0, this);
+ this.toks = toks;
} else {
bod.expand(toss, i, this);
}
} else {
bod.expand(toss, i, this);
}
@@
-54,7
+58,6
@@
public abstract class Forest<T> /*extends PrintableTree<Forest.Body<T>>*/ implem
public <B,C> void invoke(Invokable<Forest.Body<T>,B,C> ivbc, B b, C c) {
ivbc.invoke(this, b, c);
}
public <B,C> void invoke(Invokable<Forest.Body<T>,B,C> ivbc, B b, C c) {
ivbc.invoke(this, b, c);
}
- public Iterator<Body<T>> iterator() { return new SingletonIterator<Body<T>>(this); }
private final Input.Location location;
private final T tag;
private final Input.Location location;
private final T tag;