checkpoint
authoradam <adam@megacz.com>
Thu, 22 Dec 2005 01:17:03 +0000 (20:17 -0500)
committeradam <adam@megacz.com>
Thu, 22 Dec 2005 01:17:03 +0000 (20:17 -0500)
darcs-hash:20051222011703-5007d-c23f10f4f42647acc720aaafd77f80d40c8a0831.gz

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

diff --git a/TODO b/TODO
index 1dc0b33..14e38b5 100644 (file)
--- a/TODO
+++ b/TODO
@@ -134,3 +134,9 @@ Later
   - implement Johnstone's algorithm for "reduced, resolved LR
     tables" to eliminate superfluous reductions on
     epsilon-transitions.
+
+______________________________________________________________________________
+Neat Ideas
+
+  - Rekers & Koorn note that GLR Substring Parsing can be used to do
+    really elegant and generalized "autocompletion".
index 656f878..ca889b7 100644 (file)
@@ -124,6 +124,7 @@ public class MetaGrammar extends ReflectiveWalker {
         if (tree.numChildren()==0) return super.walk(tree);
         if      ("\\n".equals(head)) return new Character('\n');
         else if ("\\r".equals(head)) return new Character('\r');
+        //else if ("grammar".equals(head)) { for(Tree<String> t : tree.children()) walk(t); return this; }
         else return super.walk(tree);
     }
 
index 5a86bf1..75f2368 100644 (file)
@@ -134,12 +134,15 @@ public class RegressionTests {
         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");
-                return done("s");
-            }
-            else return super.walk(tag, args);
+        /*
+        public Object walk(Tree<String> tree) {
+            if ("grammar".equals(tree.head())) return done("s");
+            else return super.walk(tree);
+        }
+        */
+        public Object walk(String head, Object[] args) {
+            if ("grammar".equals(head)) return done("s");
+            else return super.walk(head, args);
         }
     }
 
index 292991c..64f18f9 100644 (file)
@@ -1,5 +1,5 @@
 s         ::=  ws grammar ws                  => "gram"
-ws      !::=  w**
+ws       !::=  w**
 grammar   ::=  r +/ ws                        => "grammar"
 
 r         ::=  word  ^"::=" alternatives /ws