%{ #include int lineno=0; %} %option noyywrap digit [0-9] %% \+ { return PLUS;} \- { return SUB;} "*" { return MULT;} "/" { return DIV;} {digit}+ { yylval = atoi(yytext); return NUMBER;} [\n] {++lineno; return LINE;} . {return ERROR;} %%