checkpoint
authoradam <adam@megacz.com>
Mon, 30 Jan 2006 09:15:29 +0000 (04:15 -0500)
committeradam <adam@megacz.com>
Mon, 30 Jan 2006 09:15:29 +0000 (04:15 -0500)
darcs-hash:20060130091529-5007d-b12eb361060e818895d2d019dfe84ae146f458d5.gz

TODO
src/edu/berkeley/sbp/Atom.java
src/edu/berkeley/sbp/GSS.java
src/edu/berkeley/sbp/ParseFailed.java

diff --git a/TODO b/TODO
index d9f9879..58123e7 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,6 +1,8 @@
 _____________________________________________________________________________
 Immediately
 
+  - I still don't like Atom.Infer and Atom.Invert...
+
   - Fix the metagrammar (really?)
 
   - decent/better error messages
index 70c2904..55be283 100644 (file)
@@ -30,13 +30,15 @@ public abstract class Atom<T> extends Element implements Topology<T> {
 
     // Subclasses //////////////////////////////////////////////////////////////////////////////
 
+    /** an atom which tracks the possible tokenset of some element, provided that element can only match single-token sequences */
     public static class Infer<T extends Input> extends Atom<T> {
         private final Element e;
         public Infer(Element e) { this.e = e; }
         public Topology<T> top() { return (Topology<T>)toAtom(e); }
-        public String toString() { return e.toString(); /* FIXME should be toAtom() */ }
+        public String toString() { return e.toString(); }
     }
     
+    /** an atom which tracks the inverse of some other atom */
     public static class Invert<T extends Input> extends Atom<T> {
         private final Atom<T> a;
         public Invert(Atom<T> a) { this.a = a; }
index 89a16ed..a5d6f88 100644 (file)
@@ -48,7 +48,7 @@ class GSS {
 
         private Forest forest;
 
-        public Phase(Phase prev, Parser parser, Phase previous, Tok token, Input.Location location, Forest forest) {
+        public Phase(Phase prev, Parser parser, Phase previous, Tok token, Input.Location location, Forest forest) throws ParseFailed {
             this.prev = prev;
             this.forest = forest;
             this.parser = parser;
@@ -59,7 +59,7 @@ class GSS {
             reset();
         }
 
-        public void reset() {
+        public void reset() throws ParseFailed {
             waiting.clear();
             performed.clear();
             hash = new IntPairMap<Phase.Node>();
@@ -183,7 +183,7 @@ class GSS {
         }
         
         /** perform all reduction operations */
-        public void reduce() {
+        public void reduce() throws ParseFailed{
             try {
                 reducing = true;
                 if (reducing_list==null || reducing_list.length < hash.size())
index 0fd9226..2245b67 100644 (file)
@@ -8,7 +8,7 @@ import java.io.*;
 import java.util.*;
 
 /** thrown when the parser arrives at a state from which it is clear that no valid parse can result */
-public class ParseFailed extends RuntimeException {
+public class ParseFailed extends Exception {
     private final Input.Location location;
     private final String message;
     public ParseFailed() { this("", null); }