checkpoint
authoradam <adam@megacz.com>
Tue, 13 Dec 2005 06:42:14 +0000 (01:42 -0500)
committeradam <adam@megacz.com>
Tue, 13 Dec 2005 06:42:14 +0000 (01:42 -0500)
darcs-hash:20051213064214-5007d-642722296e1ca5852e6f7c46a408204610431692.gz

src/edu/berkeley/sbp/misc/MetaGrammar.java
tests/testcase.g

index 4d8bfc5..b3b78e1 100644 (file)
@@ -88,6 +88,10 @@ public class MetaGrammar extends ReflectiveWalker {
         if (s instanceof String) s = CharToken.string((String)s);
         return new Rep(r, (Element)s, false, false);
     }
+    public Object _star__slash_(final Element r, Object s) {
+        if (s instanceof String) s = CharToken.string((String)s);
+        return new Rep(r, (Element)s, false, true);
+    }
     //public Element _star__slash_(final Element r, Element s) { return Repeat.many0(r, s); }
     //public Element _star__star_(final Element r, Element s) { return Repeat.maximal(Repeat.many0(r, s)); }
     public Object _plus__plus_(final Element r) { return new Rep(r, null, true, false); }
index 8eb36f0..0d0dd29 100644 (file)
@@ -1,5 +1,4 @@
-ts       ::= ws Ts ws => ts
-Ts       ::= test*
+ts       ::= ws test*/ws ws => ts
 ws      !::= w*
 test     ::= ^"testcase" "{" input output+/ws   Grammar "}" /ws
            | ^"testcase" "{" input              Grammar "}" /ws