checkpoint
[sbp.git] / src / edu / berkeley / sbp / Input.java
1 package edu.berkeley.sbp;
2 import java.io.*;
3 import java.util.*;
4 import java.lang.reflect.*;
5 import java.lang.ref.*;
6 import edu.berkeley.sbp.*;
7 import edu.berkeley.sbp.util.*;
8
9 /** <font color=purple>a stream of <tt>Token</tt>s to be parsed</font> */
10 public interface Input<Token> {
11
12     /** returns the token just beyond the current location and advances beyond it */
13     public Token           next() throws IOException;
14
15     /** returns the location the input stream is currently at */
16     public Location<Token> getLocation();
17
18     /** <font color=purple>a location (position) in the input stream -- <i>between tokens</i></font> */
19     public static interface Location<Token> extends Comparable<Location> {
20
21         /** return the region between this location and <tt>loc</tt> */
22         public Region<Token> createRegion(Location<Token> loc);
23
24         public String toString();
25     }
26
27     /** <font color=purple>a contiguous set of <tt>Location</tt>s</font> */
28     public static interface Region<Token> /* implements Topology<Location<Tok>> */ {
29     }
30
31 }
32
33