checkpoint
authoradam <adam@megacz.com>
Fri, 14 Jul 2006 01:02:58 +0000 (21:02 -0400)
committeradam <adam@megacz.com>
Fri, 14 Jul 2006 01:02:58 +0000 (21:02 -0400)
darcs-hash:20060714010258-5007d-8312de127672ba25e19f172bf8372f6b3fd2f938.gz

src/edu/berkeley/sbp/bind/Bindable.java
src/edu/berkeley/sbp/meta/MetaGrammar.java

index ddd6242..7c620c9 100644 (file)
@@ -29,6 +29,13 @@ public abstract class Bindable implements ToJava {
         return null;
     }
 
         return null;
     }
 
+    public Binding createBinding() {
+        return new Binding() {
+                public Object invoke(Object[] o) {
+                    return impose(o);
+                }
+            };
+    }
     public Binding createBinding(final int[] map) {
         return new Binding() {
                 public Object invoke(Object[] o) {
     public Binding createBinding(final int[] map) {
         return new Binding() {
                 public Object invoke(Object[] o) {
index 2340de2..91fd42f 100644 (file)
@@ -166,7 +166,7 @@ public class MetaGrammar {
         }
         public String toString() { return "reducer-"+_bindable.toString(); }
         public Object invoke(Iterable<Tree<Object>> t) {
         }
         public String toString() { return "reducer-"+_bindable.toString(); }
         public Object invoke(Iterable<Tree<Object>> t) {
-            if (_israw) return _bindable.impose(new Object[] { t });
+            if (_israw) return _bindable.createBinding().invoke(new Object[] { t });
             ArrayList ret = new ArrayList();
             for(Tree tc : t) {
                 if (tc.head() != null && tc.head() instanceof Functor)
             ArrayList ret = new ArrayList();
             for(Tree tc : t) {
                 if (tc.head() != null && tc.head() instanceof Functor)