#ifndef LEXER_H #define LEXER_H #include #include using std::string; using std::ifstream; enum TokenKind { ident, number, text, separator, eos }; class Lexer { private: ifstream f; char ch; void nextChar (); public: TokenKind kind; string token; void nextToken (); void error (string msg); bool isSeparator (char c); void checkSeparator (char c); string readIdent (); string readText (); public: Lexer (string fileName); }; #endif // LEXER_H