#include <iostream>
#include <iomanip>
#include "Timer.h"
#include "tokens.h"
#include "string.h"
#include "strings.h"

using namespace std;
extern int yylex();
extern char *yytext;


int main()
{
    Timer tm;
    double wallclock, user, system;
    tm.start_timer ();
    for (;;) {
        token t = yylex();
        if (t.is_end_of_input()) break;
        cout << "Lexeme = \"" << yytext << "\"" <<
                setw(30-strlen(yytext)) <<
                "Token = " << t << endl;
    }
    tm.get_elapsed_time (wallclock, user, system);
    cout << "wallclock = " << wallclock << ", user = " << user << ", system = " << system << endl;
    return 0;
}
