%{
#include <stdio.h>
%}
%%
"int" { printf("Keyword: int\n"); }
"float"
{ printf
("Keyword
: float\n"
); }"return" { printf("Keyword: return\n"); }
[0-9]+ { printf
("
Number: %s\n", yytext); } [A-Za-z_][A-Za-z0-9_]* { printf("Identifier: %s\n", yytext); }
. { /* Ignore other characters */ }
%%
int main() {
printf("Enter a string: ");
yylex();
return 0;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgolJQoKImludCIgICAgICB7IHByaW50ZigiS2V5d29yZDogaW50XG4iKTsgfQoiZmxvYXQiICAgIHsgcHJpbnRmKCJLZXl3b3JkOiBmbG9hdFxuIik7IH0KInJldHVybiIgICB7IHByaW50ZigiS2V5d29yZDogcmV0dXJuXG4iKTsgfQoKWzAtOV0rICAgICB7IHByaW50ZigiTnVtYmVyOiAlc1xuIiwgeXl0ZXh0KTsgfQpbQS1aYS16X11bQS1aYS16MC05X10qIHsgcHJpbnRmKCJJZGVudGlmaWVyOiAlc1xuIiwgeXl0ZXh0KTsgfQoKLiAgICAgICAgICB7IC8qIElnbm9yZSBvdGhlciBjaGFyYWN0ZXJzICovIH0KCiUlCgppbnQgbWFpbigpIHsKICAgIHByaW50ZigiRW50ZXIgYSBzdHJpbmc6ICIpOwogICAgeXlsZXgoKTsKICAgIHJldHVybiAwOwp9Cg==