checkpoint
authoradam <adam@megacz.com>
Mon, 16 Jan 2006 00:01:56 +0000 (19:01 -0500)
committeradam <adam@megacz.com>
Mon, 16 Jan 2006 00:01:56 +0000 (19:01 -0500)
darcs-hash:20060116000156-5007d-4e70a5bd713ece0f7378a48e20db7f7c1aaa8318.gz

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

index e4c0a78..6a20fdf 100644 (file)
@@ -146,7 +146,7 @@ public class MetaGrammar extends StringWalker {
         else if ("=>".equals(head)) {
             PreSequence p = (PreSequence)walk(tree, 0);
             p.tag = string(tree.child(1));
-            return p.buildSequence(null, false, p.tag==null);
+            return p.buildSequence(null, false, "()".equals(p.tag));
         }
         else if ("[]".equals(head)) { PreSequence p = (PreSequence)walk(tree, 0); p.unwrap = true; return p; }
         else if ("psy".equals(head)) return (PreSequence)walk(tree, 0);
index 97455eb..2537fb9 100644 (file)
@@ -60,8 +60,8 @@ testcase {
     input "aaabbbbccc";
 
     s   ::= ab & dc
-    ab !::= a b       => ab
-    dc !::= d c       => dc
+    ab  ::= a b       => ab
+    dc  ::= d c       => dc
     a   ::= "a" a     | ()
     b   ::= "b" b "c" | ()
     c   ::= "c" c     | ()
@@ -72,7 +72,7 @@ testcase {
     input "aabb";
     output "xbx:{abab:{a b}}";
 
-    x  !::= ~[]
+    x   ::= ~[] => ()
     s   ::= x* b x* => xbx
     b   ::= [ab][ab] => abab
          &~ ( "aa" | "bb" )
index 75380bd..a7972a4 100644 (file)
@@ -1,4 +1,4 @@
-ts       ::= ws tests ws => ts
+ts       ::= !ws tests !ws => ts
 tests    ::= test */ ws
 ws       !::= w*
 test     ::= ^"testcase" "{" input output +/ ws   Grammar "}" /ws