- public static class TestCaseMaker extends ReflectiveMeta {
- 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
- });
- }
- public static class TestCaseMakerHelper extends MG {
- public static @tag("grammaro") @raw Object grammaro(Iterable<Tree> t) {
- System.out.println("working on " + t);
- return Demo.make(t.iterator().next(), "s", new ReflectiveMetaPlain());
- }
- //public static @tag("tca") Object tca(Object[] o) throws IOException {
- //return new TestCase((String)o[0], (String[])o[1], (Union)o[2], false, false); }
- public static @tag("tca") Object tca(String input, String[] output, Union u) throws IOException {
- return new TestCase(input, output, u, false, false); }
- public static @tag("tcb") Object tca(String input, Union u) throws IOException {
- return new TestCase(input, new String[0], u, false, false); }
- public static @tag("ts") TestCase[] go(TestCase[] cases) { return cases; }
- public static @tag("o") Object o(Object[] s) { return s; }
- }
- }
-