%{ #include %} %% [-+0-9]+ { printf ("%s is not a float.\n", yytext); } [-+0-9]*(\.)[0-9]+ {printf("%s is a float.\n",yytext);} [a-zA-Z]+ { printf ("%s is not a number.\n", yytext); } %% int yywrap(){} int main() { printf("\nA lex specification to recognize Integer:\nEnter your input: "); yylex(); return 0; }