- public static class TestCaseMaker extends AnnotationGrammarBindingResolver {
- public TestCaseMaker() {
- super(TestCaseMakerHelper.class);
- //add(MetaGrammarBindings.class, "grammar.");
- add(MetaGrammarBindings.class, "");
- }
- public static class TestCaseMakerHelper {
- public static @bind.as("grammaro") @bind.raw Object grammaro(Iterable<Tree> t) {
- 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); }
- public static @bind.as("tca") Object tca(String input, String[] output, Union u) throws IOException {
- return new TestCase(input, output, u, false, false); }
- public static @bind.as("tcb") Object tca(String input, Union u) throws IOException {
- return new TestCase(input, new String[0], u, false, false); }
- public static @bind.as("ts") TestCase[] go(TestCase[] cases) { return cases; }
- public static @bind.as("o") Object o(Object[] s) { return s; }
- }
- }
-