checkpoint
[sbp.git] / src / edu / berkeley / sbp / tib / Tib.java
index df56855..167ad8b 100644 (file)
@@ -25,15 +25,14 @@ import java.io.*;
  *   possible (it is unclear whether or not the associated grammar is
  *   context-free).
  */
  *   possible (it is unclear whether or not the associated grammar is
  *   context-free).
  */
-public class Tib /*implements Token.Stream<TibToken>*/ {
+public class Tib /*implements Token.Stream<TreeToken<String>>*/ {
     /*
     /*
+    public final String str;
 
 
-    private String str;
-
+    public Tib(String s) { this(new StringReader(s)); }
+    public Tib(Reader r) { this(new BufferedReader(r)); }
     public Tib(InputStream is) { this(new BufferedReader(new InputStreamReader(is))); }
     public Tib(InputStream is) { this(new BufferedReader(new InputStreamReader(is))); }
-    public Tib(BufferedReader br) {
-        Block b = parse(br);
-    }
+    public Tib(BufferedReader br) { str = parse(br).toString(0,-1); }
 
     public Token next() throws IOException {
         if (pos >= str.length()) return Atom.EOF;
 
     public Token next() throws IOException {
         if (pos >= str.length()) return Atom.EOF;
@@ -241,6 +240,6 @@ public class Tib /*implements Token.Stream<TibToken>*/ {
         }
         return ret.toString();
     }
         }
         return ret.toString();
     }
-    */    
+    */
 }
 
 }