%{
#include <stdio.h>
%}
%%
int
|float|char
|return
{ printf
("Keyword
: %s\n", yytext); }[+\-*/=<>!]=? { printf("Operator: %s\n", yytext); }
[a-zA-Z_][a-zA-Z0-9_]* { printf("Identifier: %s\n", yytext); }
";" { printf("Semicolon: %s\n", yytext); }
[ \t\n] ; // Ignore whitespaces
. { printf("Unknown Token: %s\n", yytext); }
%%
int main() {
yylex();
return 0;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgolJQppbnR8ZmxvYXR8Y2hhcnxyZXR1cm4geyBwcmludGYoIktleXdvcmQ6ICVzXG4iLCB5eXRleHQpOyB9ClsrXC0qLz08PiFdPT8geyBwcmludGYoIk9wZXJhdG9yOiAlc1xuIiwgeXl0ZXh0KTsgfQpbYS16QS1aX11bYS16QS1aMC05X10qIHsgcHJpbnRmKCJJZGVudGlmaWVyOiAlc1xuIiwgeXl0ZXh0KTsgfQoiOyIgeyBwcmludGYoIlNlbWljb2xvbjogJXNcbiIsIHl5dGV4dCk7IH0KWyBcdFxuXSA7IC8vIElnbm9yZSB3aGl0ZXNwYWNlcwouIHsgcHJpbnRmKCJVbmtub3duIFRva2VuOiAlc1xuIiwgeXl0ZXh0KTsgfQolJQoKaW50IG1haW4oKSB7CiAgICB5eWxleCgpOwogICAgcmV0dXJuIDA7Cn0K