1 package edu.berkeley.sbp;
4 import java.lang.reflect.*;
5 import java.lang.ref.*;
6 import edu.berkeley.sbp.*;
7 import edu.berkeley.sbp.util.*;
9 /** <font color=purple>a stream of <tt>Token</tt>s to be parsed</font> */
10 public interface Input<Token> {
12 /** returns the token just beyond the current location and advances beyond it */
13 public Token next() throws IOException;
15 /** returns the location the input stream is currently at */
16 public Location<Token> getLocation();
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> {
21 /** return the region between this location and <tt>loc</tt> */
22 public Region<Token> createRegion(Location<Token> loc);
24 public String toString();
27 /** <font color=purple>a contiguous set of <tt>Location</tt>s</font> */
28 public static interface Region<Token> /* implements Topology<Location<Tok>> */ {