%{
#include <stdio.h>
%}
%%
int
{ printf
("Keyword
: int\n"
); } float { printf
("Keyword
: float\n"
); } if
{ printf
("Keyword
: if\n"
); }[0-9]+ { printf
("
Number: %s\n", yytext); } [a-zA-Z]+ { printf("Identifier: %s\n", yytext); }
. { /* Ignore other characters */ }
%%
int main() {
yylex(); return 0;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgolJQoKaW50CQl7IHByaW50ZigiS2V5d29yZDogaW50XG4iKTsgfSBmbG9hdAkJCXsgcHJpbnRmKCJLZXl3b3JkOiBmbG9hdFxuIik7IH0gaWYJeyBwcmludGYoIktleXdvcmQ6IGlmXG4iKTsgfQpbMC05XSsJeyBwcmludGYoIk51bWJlcjogJXNcbiIsIHl5dGV4dCk7IH0KW2EtekEtWl0rIHsgcHJpbnRmKCJJZGVudGlmaWVyOiAlc1xuIiwgeXl0ZXh0KTsgfQouCXsgLyogSWdub3JlIG90aGVyIGNoYXJhY3RlcnMgKi8gfQoKJSUKCmludCBtYWluKCkgewp5eWxleCgpOyByZXR1cm4gMDsKfQoK