/* Lexical analyser for `flex` */ %{ #include "eval.tab.h" // From bison %} %option noinput %option nounput %option noyywrap VOID [ \n\t] %% [0-9]+ yylval = atoi(yytext); return number; // Number token [-*+()=/] return yytext[0]; // Operators {VOID}+ ; // Skip white characters . fprintf(stderr, "Input '%c' unknown\n", yytext[0]); // Fallback error