%{
#include<stdio.h>
}
%%
if|else|while|for|switch {printf("%s is a key word", yytext); }
[a-z A-Z] {printf("%s is a indentifer");}
[0-9] {printf("%s is a constant", yytext); }
.* {printf
("It
is invalid input"
); } %%
void main(){
printf("Enter value: ");
yylex();
return 0;
}
int yywrap(){
return 1;
}
JXsKICAgICNpbmNsdWRlPHN0ZGlvLmg+Cn0KJSUKaWZ8ZWxzZXx3aGlsZXxmb3J8c3dpdGNoIHtwcmludGYoIiVzIGlzIGEga2V5IHdvcmQiLCB5eXRleHQpOyB9ClthLXogQS1aXSB7cHJpbnRmKCIlcyBpcyBhIGluZGVudGlmZXIiKTt9ClswLTldIHtwcmludGYoIiVzIGlzIGEgY29uc3RhbnQiLCB5eXRleHQpOyB9Ci4qIHtwcmludGYoIkl0IGlzIGludmFsaWQgaW5wdXQiKTsgfQolJQoKdm9pZCBtYWluKCl7CiAgICBwcmludGYoIkVudGVyIHZhbHVlOiAiKTsKICAgIHl5bGV4KCk7CiAgICByZXR1cm4gMDsKfQoKaW50IHl5d3JhcCgpewogICAgcmV0dXJuIDE7Cn0=