checkpoint
authoradam <adam@megacz.com>
Sun, 22 Jan 2006 09:21:33 +0000 (04:21 -0500)
committeradam <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

index df7a3ea..933515b 100644 (file)
@@ -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) {
-                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);
             }
@@ -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 Iterator<Body<T>> iterator() { return new SingletonIterator<Body<T>>(this); }
 
         private final Input.Location    location;
         private final T                 tag;