checkpoint
authoradam <adam@megacz.com>
Sun, 15 Jan 2006 08:21:37 +0000 (03:21 -0500)
committeradam <adam@megacz.com>
Sun, 15 Jan 2006 08:21:37 +0000 (03:21 -0500)
darcs-hash:20060115082137-5007d-50dfcaf611d5d68776360f5a1387f6ee64d5e374.gz

TODO
src/edu/berkeley/sbp/Atom.java
src/edu/berkeley/sbp/misc/CharToken.java

diff --git a/TODO b/TODO
index fb89b52..1d62802 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,11 +1,12 @@
 _____________________________________________________________________________
 Immediately
 
-  - clean up the whole Walk situation (?)
-
   - decent/better error messages
       - fix the location stuff, it's broken
 
+  - copyright notices
+
+  - documentation
 
 ______________________________________________________________________________
 v1.1
@@ -16,6 +17,7 @@ v1.1
       - TeX (math?)
       - URL (RFC)
       - RFC2822 (email message/headers)
+  - clean up the whole Walk situation (?)
 
 
 ______________________________________________________________________________
index 2589dde..59ecb59 100644 (file)
@@ -8,7 +8,7 @@ import edu.berkeley.sbp.*;
 import edu.berkeley.sbp.*;
 
 /** an element which matches exactly one input token */
-public abstract class Atom<T extends Token> extends Element implements Topology<T> {
+public abstract class Atom<T> extends Element implements Topology<T> {
 
     protected abstract Topology<T> top();
     public    abstract String toString();
index 2042145..8efdb04 100644 (file)
@@ -4,18 +4,17 @@ import java.util.*;
 import java.lang.reflect.*;
 import java.lang.ref.*;
 import edu.berkeley.sbp.*;
-import edu.berkeley.sbp.*;
+import edu.berkeley.sbp.Token.Location;
 import edu.berkeley.sbp.util.*;
-import edu.berkeley.sbp.*;
 
 /** an implementation of Token for streams of Java <tt>char</tt> values */
-public class CharToken implements Token, IntegerMappable {
+public class CharToken implements IntegerMappable {
 
     // Public //////////////////////////////////////////////////////////////////////////////
 
     public static class CharToStringParser extends Parser<CharToken,String> {
         public CharToStringParser(Union u) { super(u, new IntegerTopology<CharToken>()); }
-        public Forest<String> shiftToken(CharToken ct, Token.Location loc) {
+        public Forest<String> shiftToken(CharToken ct, Location loc) {
             return Forest.create(loc, ct.result(), null, false, false);
         }
     }
@@ -117,7 +116,7 @@ public class CharToken implements Token, IntegerMappable {
     }
     
     /** an implementation of Token.Stream for sequences of characters */
-    public static class Stream implements Token.Stream {
+    public static class Stream implements Token.Stream<CharToken> {
         private final String message;
         private final Reader r;
         private int line  = 1;
@@ -151,14 +150,14 @@ public class CharToken implements Token, IntegerMappable {
         }
 
         long then = 0;
-        private Token.Location location = new LocWrap(1, 1);
-        public Token.Location getLocation() { return location; }
-        public Token next(int numstates, int resets, int waits) throws IOException {
+        private Location location = new LocWrap(1, 1);
+        public Location getLocation() { return location; }
+        public CharToken next(int numstates, int resets, int waits) throws IOException {
             int i = r.read();
             if (i==-1) return null;
             char c = (char)i;
             location = new LocWrap(line, col);
-            Token ret = new CharToken(c);
+            CharToken ret = new CharToken(c);
             String s = line + "";
             while(s.length() < 4) s = " " + s;
             s = "line "+s+", col " + col;