checkpoint
authoradam <adam@megacz.com>
Thu, 15 Dec 2005 08:48:37 +0000 (03:48 -0500)
committeradam <adam@megacz.com>
Thu, 15 Dec 2005 08:48:37 +0000 (03:48 -0500)
darcs-hash:20051215084837-5007d-a04876953d0928d371998af263895cfa84b14783.gz

TODO
src/edu/berkeley/sbp/misc/RegressionTests.java
tests/meta.g
tests/regression.tc
tests/testcase.g

diff --git a/TODO b/TODO
index 5368def..9c1b408 100644 (file)
--- a/TODO
+++ b/TODO
@@ -4,6 +4,12 @@ Immediately
   - Lay down the law on the different kinds of Sequence productions
     and how they work.
 
+     => mydrop
+     => mylift
+
+  - whitespace-in-braces?
+  - Deal with the problem of zero-rep productions and whitespace insertion
+
   - switch maximal to not-followed-by (~/~)
 
   - should Union.add() be there?
index 8d165ff..5a86bf1 100644 (file)
@@ -129,12 +129,14 @@ public class RegressionTests {
             return new TestCase(input, output,        grammar, false); }
         public TestCase testcase(String input,                  Union grammar) throws IOException {
             return new TestCase(input, new String[0], grammar, false); }
+        public TestCase tibcase(String input, String[] output, Union grammar) throws IOException {
+            return new TestCase(input, output,        grammar, true); }
         public TestCase  tibcase(String input,                  Union grammar) throws IOException {
             return new TestCase(input, new String[0], grammar, true); }
         public MetaGrammar grammar(Object[] o) { return this; }
         public Object walk(String tag, Object[] args) {
             if ("grammar".equals(tag)) {
-                System.out.println("\n" + this + "\n");
+                //System.out.println("\n" + this + "\n");
                 return done("s");
             }
             else return super.walk(tag, args);
index 0e3bce7..5723e6d 100644 (file)
@@ -4,8 +4,7 @@ grammar   ::=  r +/ ws                        => "grammar"
 r         ::=  word  ^"::=" alternatives /ws
             |  word ^"!::=" alternatives /ws
 
-alternatives  ::=  equiAlt   +/ (ws ">" ws)
-equiAlt       ::=  conjuncts +/ (ws "|" ws)
+alternatives  ::=  (conjuncts +/ (ws "|" ws)) +/ (ws ">" ws)
 
 conjuncts   ::=  sequence
               |  sequence ^"&"  e*/ws   /ws
@@ -21,10 +20,10 @@ ec       ::= [~\-\]\\\~]
 range    ::= ec          => "range"
            | ec ^"-" ec
 
-e        ::= word                           => "nonTerminal"
+e        ::=  word                          => "nonTerminal"
            |  quoted                        => "literal"
            |    ^"()"
-           |    ^"{" sequence "}"   /ws
+           |    ^"{" sequence "}"       /ws
            |    ^"["  (range*) "]"
            |    ^"[~" (range*) "]"
            |    ^"^" quoted             /ws
index 902d852..6196b48 100644 (file)
@@ -27,8 +27,9 @@ tibcase {
     how
      { are }
 ";
+    output "yep";
 
-    s        ::= { Hello }
+    s        ::= { Hello } => "yep"
     w        ::= " " | "\n"
     ws      !::= w**
     Hello    ::= "hello" ws { ws "there" ws "how" ws { { "are" } ws } }
index b42a410..33c00b7 100644 (file)
@@ -3,6 +3,7 @@ tests    ::= test */ ws
 ws       !::= w*
 test     ::= ^"testcase" "{" input output +/ ws   grammar "}" /ws
            | ^"testcase" "{" input                grammar "}" /ws
+           | ^"tibcase"  "{" input output +/ ws   grammar "}" /ws
            | ^"tibcase"  "{" input                grammar "}" /ws
 output   ::= "output" quoted ";" /ws
 input    ::= "input"  quoted ";" /ws