checkpoint
authoradam <adam@megacz.com>
Tue, 13 Dec 2005 07:49:28 +0000 (02:49 -0500)
committeradam <adam@megacz.com>
Tue, 13 Dec 2005 07:49:28 +0000 (02:49 -0500)
darcs-hash:20051213074928-5007d-2f965a332dc03602ff011745ad2fe5f34ff15cda.gz

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

index 644b40a..42db7c2 100644 (file)
@@ -92,6 +92,10 @@ public class MetaGrammar extends ReflectiveWalker {
         if (s instanceof String) s = CharToken.string((String)s);
         return new Rep(r, (Element)s, false, true);
     }
         if (s instanceof String) s = CharToken.string((String)s);
         return new Rep(r, (Element)s, false, true);
     }
+    public Object _percent__percent_(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 Object _star__star_(final Element r) { return new Rep(r, null, true, true); }
     public Object _plus__plus_(final Element r) { return new Rep(r, null, true, false); }
     //public Element _star__slash_(final Element r, Element s) { return Repeat.many0(r, s); }
     public Object _star__star_(final Element r) { return new Rep(r, null, true, true); }
     public Object _plus__plus_(final Element r) { return new Rep(r, null, true, false); }
index 5b4cf6a..9755cfc 100644 (file)
@@ -12,7 +12,8 @@ equiAlt       ::=  conjuncts +/ (ws "|" ws)          => "alternatives"
 sequence    ::= Es
               > Es ^"/" e  /ws
 Es          ::= e+
 sequence    ::= Es
               > Es ^"/" e  /ws
 Es          ::= e+
-es          ::= e+/ws
+//es          ::= e+/ws
+
 
 conjuncts   ::=  rewrite
               |  rewrite ^"&"  sequence   /ws
 
 conjuncts   ::=  rewrite
               |  rewrite ^"&"  sequence   /ws
@@ -31,6 +32,7 @@ e        ::= word                             => "nonTerminalY"
            |    ^"{" alternatives "}"   /ws
            |     "[" [\~]?  range* "]"        => "range"
            |  e ^"*/" e                 /ws
            |    ^"{" alternatives "}"   /ws
            |     "[" [\~]?  range* "]"        => "range"
            |  e ^"*/" e                 /ws
+           |  e ^"%%" e                 /ws
            |  e ^"+/" e                 /ws
            |  e ^"?"                    /ws
            |  e ^"~/~"                  /ws
            |  e ^"+/" e                 /ws
            |  e ^"?"                    /ws
            |  e ^"~/~"                  /ws
index 50b5859..920717e 100644 (file)
@@ -1,4 +1,5 @@
-ts       ::= ws test*/ws ws => ts
+ts       ::= ws tests ws => ts
+tests    ::= test %% ws
 ws       !::= w*
 test     ::= ^"testcase" "{" input output+/ws   grammar "}" /ws
            | ^"testcase" "{" input              grammar "}" /ws
 ws       !::= w*
 test     ::= ^"testcase" "{" input output+/ws   grammar "}" /ws
            | ^"testcase" "{" input              grammar "}" /ws