checkpoint
[sbp.git] / src / edu / berkeley / sbp / misc / RegressionTests.java
index 6f69ac3..1646a17 100644 (file)
@@ -4,11 +4,12 @@ import java.util.*;
 import java.lang.reflect.*;
 import edu.berkeley.sbp.*;
 import edu.berkeley.sbp.misc.*;
+import edu.berkeley.sbp.meta.*;
 import edu.berkeley.sbp.bind.*;
 import edu.berkeley.sbp.tib.*;
 import edu.berkeley.sbp.chr.*;
 import edu.berkeley.sbp.util.*;
-import static edu.berkeley.sbp.misc.MetaGrammar.*;
+import static edu.berkeley.sbp.meta.MetaGrammar.*;
 
 public class RegressionTests {
 
@@ -34,6 +35,7 @@ public class RegressionTests {
             System.err.println("parsing " + s[0]);
             Tree<String> res = new CharParser(MetaGrammar.make()).parse(new FileInputStream(s[0])).expand1();
             Union meta = MetaGrammar.make(res, "s");
+
             System.err.println("parsing " + s[1]);
             SequenceInputStream sis = new SequenceInputStream(new FileInputStream(s[0]), new FileInputStream(s[1]));
             res = new CharParser(meta).parse(sis).expand1();
@@ -88,25 +90,14 @@ public class RegressionTests {
         }
     }
 
-    public static class TestCaseMaker extends ReflectiveMeta {
+    public static class TestCaseMaker extends AnnotationGrammarBindingResolver {
         public TestCaseMaker() {
-            super(TestCaseMakerHelper.class, new Class[] {
-                     MG.Grammar.class,
-                     MG.NonTerminal.class,
-                     MG.AnonUn.class,
-                     MG.Range.class,
-                     MG.El.class,
-                     MG.Seq.class,
-                     MG.NonTerminalReference.class,
-                     MG.StringLiteral.class,
-                     MG.XTree.class,
-                     MG.CharClass.class
-            });
+            super(TestCaseMakerHelper.class);
         }
-        public static class TestCaseMakerHelper extends MG {
+        public static class TestCaseMakerHelper extends MetaGrammarBindings {
             public static @bind.as("grammaro") @bind.raw Object grammaro(Iterable<Tree> t) {
                 System.out.println("working on " + t);
-                return MetaGrammar.make(t.iterator().next(), "s", new ReflectiveMetaPlain());
+                return MetaGrammar.make(t.iterator().next(), "s", new TaggingGrammarBindingResolver());
             }
             //public static @bind.as("tca")           Object tca(Object[] o) throws IOException {
             //return new TestCase((String)o[0], (String[])o[1], (Union)o[2], false, false); }