/* SI 413 Fall 2011 * Lab 5 * ex2.lpp */ %{ #include <iostream> using namespace std; #include "ex2.tab.hpp" %} %option noyywrap %% [0-9]+ { return NUM; } [+-] { return OPA; } [*/] { return OPM; } [><=] { return COMP; } "(" { return LP; } ")" { return RP; } ";" { return STOP; } <<EOF>> { return 0; } [ \t\n]+ { } . { cerr << "Unrecognized token!" << endl; exit(1); } %%