checkpoint
authoradam <adam@megacz.com>
Tue, 13 Dec 2005 07:04:31 +0000 (02:04 -0500)
committeradam <adam@megacz.com>
Tue, 13 Dec 2005 07:04:31 +0000 (02:04 -0500)
darcs-hash:20051213070431-5007d-7f5c8e6be6e105016c0f2176660f30db09541a3f.gz

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

index 0f75ecd..627300d 100644 (file)
@@ -93,7 +93,7 @@ public class MetaGrammar extends ReflectiveWalker {
         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 _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 _question_(final Element r) { return Repeat.maybe(r); }
         public MetaGrammar gram(Object o, MetaGrammar g, Object o2) { return g; }
index 074b9f3..f16c60a 100644 (file)
@@ -1,5 +1,5 @@
 s         ::=  w* Grammar w*                  => "gram"
-ws       !::=  w*
+ws       !::=  w**
 grammar   ::=  R+/ws => "grammar"
 Grammar   ::=  R+ => "grammar"
 R         ::=  word  ^"::=" Alternatives
@@ -12,7 +12,7 @@ EquiAlt       ::=  Conjuncts +/ "|"                 => "alternatives"
 
 sequence    ::= Es ^"/" E   /ws
               > Es
-es ::= E+/ws
+Es ::= E+
 
 Conjuncts   ::=  rewrite
               |  rewrite ^"&"  sequence