%option noyywrap %{ #include void yyerror(char*); #include "y.tab.h" %} %% digit[0-9]+{ yylvl=atoi(yytext); return INTEGER; } [-+/n] return *yytext; [\t]; /* skip whitespace*/ .yyerror("Invalid charecter"); %% int yywrap(void) { return 1; }