checkpoint
[sbp.git] / src / edu / berkeley / sbp / misc / RegressionTests.java
index 9c1290b..d870ae2 100644 (file)
@@ -33,7 +33,7 @@ public class RegressionTests {
 
             System.err.println("parsing " + s[0]);
             Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(s[0])).expand1();
 
             System.err.println("parsing " + s[0]);
             Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(s[0])).expand1();
-            Union meta = Grammar.create(res, "s");
+            Union meta = Grammar.create(res, "s", new MetaGrammarBindings());
 
             System.err.println("parsing " + s[1]);
             //SequenceInputStream sis = new SequenceInputStream(new FileInputStream(s[0]), new FileInputStream(s[1]));
 
             System.err.println("parsing " + s[1]);
             //SequenceInputStream sis = new SequenceInputStream(new FileInputStream(s[0]), new FileInputStream(s[1]));
@@ -89,7 +89,7 @@ public class RegressionTests {
         }
     }
 
         }
     }
 
-    public static class TestCaseMaker extends AnnotationGrammarBindingResolver {
+    public static class TestCaseMaker extends AnnotationGrammarBindings {
         public TestCaseMaker() {
             super(TestCaseMakerHelper.class);
             add(MetaGrammarBindings.class, "grammar");
         public TestCaseMaker() {
             super(TestCaseMakerHelper.class);
             add(MetaGrammarBindings.class, "grammar");
@@ -97,7 +97,7 @@ public class RegressionTests {
         }
         public static class TestCaseMakerHelper {
             public static @bind.as("grammaro") @bind.raw Object grammaro(Iterable<Tree> t) {
         }
         public static class TestCaseMakerHelper {
             public static @bind.as("grammaro") @bind.raw Object grammaro(Iterable<Tree> t) {
-                return Grammar.create(t.iterator().next(), "s", new TaggingGrammarBindingResolver());
+                return Grammar.create(t.iterator().next(), "s", new Grammar.Bindings());
             }
             //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); }
             }
             //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); }
@@ -194,13 +194,13 @@ public class RegressionTests {
     public static class TestCaseBuilder extends StringWalker {
         public Object walk(Tree<String> tree) {
             try {
     public static class TestCaseBuilder extends StringWalker {
         public Object walk(Tree<String> tree) {
             try {
-                if ("grammaro".equals(tree.head())) return Grammar.create(tree, "s");
+                if ("grammaro".equals(tree.head())) return Grammar.create(tree, "s", new MetaGrammarBindings());
                 else if ("output".equals(tree.head())) return string(tree.children());
                 else if ("input".equals(tree.head())) return string(tree.children());
                 else if ("testcase".equals(tree.head())) {
                     String input = string(tree.child(0));
                     String[] output = tree.numChildren()>2 ? ((String[])walk(tree, 1)) : new String[0];
                 else if ("output".equals(tree.head())) return string(tree.children());
                 else if ("input".equals(tree.head())) return string(tree.children());
                 else if ("testcase".equals(tree.head())) {
                     String input = string(tree.child(0));
                     String[] output = tree.numChildren()>2 ? ((String[])walk(tree, 1)) : new String[0];
-                    Union grammar = Grammar.create(tree.child(tree.numChildren()-1), "s");
+                    Union grammar = Grammar.create(tree.child(tree.numChildren()-1), "s", new MetaGrammarBindings());
                     TestCase tc = new TestCase(input, output, grammar, false, false);
                     return tc;
                 } else if ("ts".equals(tree.head())) return walk(tree, 0);
                     TestCase tc = new TestCase(input, output, grammar, false, false);
                     return tc;
                 } else if ("ts".equals(tree.head())) return walk(tree, 0);