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.*;
8 import edu.berkeley.sbp.*;
10 /** a token of input -- note that this represents an <i>actual input token</i> rather than an <tt>Element</tt> which <i>matches</i> a token */
11 public interface Token {
13 /** this is declared abstract as a way of forcing subclasses to provide a thoughtful implementation */
14 public abstract String toString();
16 /** a sequence of input tokens; returns null when EOF is reached */
17 public static interface Stream<Tok> {
18 public Tok next(int numstates, int resets, int waits) throws IOException;
19 public abstract Location getLocation();
22 /** a location *between tokens* in the input stream */
23 public static interface Location {
24 public String toString();