/**
 * This class represents the most basic possible form of token, supporting
 * only the raw token string and a token type field (integer).  More
 * sophisticated token types can be realized by extending it.
 *
 * @author Terran Lane
 * @version 1.0
 */
public class BaseToken implements Token {

  public BaseToken(String tstr, int ttype) {
    if (tstr==null) {
      throw new NullPointerException("String arg to BaseToken constructor" +
				     "must be non-null");
    }
    if (ttype<0) {
      throw new IllegalArgumentException("Token type arg to BaseToken " +
					 "constructor must be >=0, not " +
					 "ttype=" + ttype);
    }
    _s=tstr;
    _t=ttype;
  }

  public String getTokStr() { return _s; }
  public int getTokType() { return _t; }

  public static final int T_INT=1;
  public static final int T_WORD=2;
  public static final int T_UNKN=0;

  /* ******************** end of public interface ******************** */

  private final String _s;
  private final int _t;
}
