#ifndef lexanH
#define lexanH

#include <iostream>
#include <fstream>
#include <list>
#include <stdexcept>

#include "UMStr.h"

using namespace std;

#define LEX_NULL     0
#define LEX_ERROR    1
#define LEX_INPUT    1000  //kw
#define LEX_OUTPUT   1001  //kw
#define LEX_AND      5  //kw
#define LEX_OR       6  //kw
#define LEX_NAND     7  //kw
#define LEX_NOR      8  //kw
#define LEX_XOR      9  //kw
#define LEX_XNOR     10 //kw
#define LEX_NOT      11 //kw
#define LEX_BUFF     12 //kw
#define LEX_INTEGER  16
#define LEX_REAL     17
#define LEX_ASSIGN   21
#define LEX_LPA      23
#define LEX_RPA      24
#define LEX_IDENT    28
#define LEX_COMMA    30


class Lexan {
    ifstream F;
    list<pair<int,MStr> > keywords;
    void kw_init();

public:
    int Lex_AInt;
    double Lex_AReal;
    MStr Lex_AStr;
    int rowcount;
    Lexan(){};
    void init(const char *);
    int NextToken();
    ~Lexan(){F.close();}
};

#endif
