import java.io.IOException;
/**
 * An interface for a generic, table-driven lexical analyzer.  This analyzer
 * presents a sequential view of the token stream.  It supports hasNext() and
 * next() methods, much like {@link java.util.Iterator}, but it does not
 * actually extend Iterator because it specializes {@link next()} to return
 * {@link Token} objects.  All classes implementing this interface should
 * provide a constructor that accepts a Reader.
 *
 * @author Terran Lane
 * @version 1.0
 */

public interface Lexer {

  public boolean hasNext();

  public Token next() throws IOException;

  /**
   * This method provides a way to push at least one token back onto the
   * token stream.  It may optionally support multi-token push back as well.
   * Later calls to {@link next()} will return any tokens pushed back (in
   * LIFO order) before any new tokens from the underlying data stream.
   *
   * @param t Token to push back onto the stream.
   * @return Number of tokens available in the pushBack buffer after
   * insertion of this Token.
   */
  public int pushBack(Token t);
}
