/*  This  Tokens - by inheritance from Adts.

    To use this  must include  Token  in your #include clause, e.g.,

        #include Crt, Tokens;

    Author: Larry Morell

    Revision history

    Date       Modification
    2/17/93    Original version
    2/26/93    Added XUnitSym"s to the Token Typees
    4/2/99     Converted to C++
*/
#ifndef TOKENS
#define TOKENS
using namespace std;
#include <stdio.h>
#include <string>
#include "IntSets.h"
#define Text FILE *

const int doTest = false;

   enum TokenType {
      ctagSym,
      errorSym, 
      eofSym, 
      initSym, 
      otagSym,
      stuffSym
      };

class TokenDesc 
{ public:
    TokenType type;
    string val;
};

class Token {
  public:
    Token(TokenType C);               // initialize token to ("",C) 
    Token(TokenType C, string s);      // initialize token to (s,C) 
    Token();
    ~Token();                         // destroy a Token
    void init(TokenType C, string s);  // initialize token to (s,C) 
    void init(TokenType C);           // initialize tokenn to ("",C)
    void Token::copy(Token &A);
    void Token::initcopy(Token &A);
    void done();                      // destroy a Token
    virtual void display();       // write token 
    virtual void displayln();       // write token 
    virtual void get();
    virtual void getStuff();
    virtual int size(); 
    virtual int equal(Token &A); 
    TokenType type();
    void setType(TokenType t);
    string val();
    void setVal(string v);
  private:
    virtual void getBuf(IntSet t);   // get an internal
    TokenDesc * P;
};

void getChar();
void setTokenSource(string Filename);
TokenType succ(TokenType s);
string  tokenTypeStr(TokenType C);

extern  char    ch;  /* The global character */
extern  Token   t ;  /* The global token */

#endif

