// textest.cpp : a simple driver for the the Lexer class #include #include "Lexer.h" using namespace std; int main() { Lexer lexer; Token tok; string line; while (cin) { cout << "> "; getline(cin, line); lexer.set_input(line); while (lexer.has_more_token()) { tok = lexer.next_token(); if (tok.type == IDENT) cout << "IDENT: " << tok.value << endl; if (tok.type == STRING) cout << "STR: " << tok.value << endl; if (tok.type == ERRTOK) cout << "Don't drink and type" << endl; } } return 0; }