%option noyywrap %{ #include %} digit[0-9] letter[A-Za-Z] key "int"|"main"|"for"|"return"|"printf"|"while"|"scanf"|"if" %% {key} {printf("%s is a keyword and length is: %d\n",yytext,yyleng);} {letter} ({letter}|{digit})* {printf(%s is an identifier and length is: %d",yytext,yyleng);} [digit}+{printf("%s is an int value is %d\n",yytext,atoi(yytext));} {digit}+"."{digit}+{printf("%s is a folatingpoint number and folating value is %f\n",yytext,atof(yytext));} %% int main() { return 0; }