%{
#include <stdio.h>
#include <stdlib.h>
%}

%%
"int"        { printf("Keyword: int\n"); }
"float"      { printf("Keyword: float\n"); }
"if"         { printf("Keyword: if\n"); }
"else"       { printf("Keyword: else\n"); }
[0-9]+       { printf("Integer: %s\n", yytext); }
[0-9]+\.[0-9]+ { printf("Float: %s\n", yytext); }
[a-zA-Z_][a-zA-Z0-9_]* { printf("Identifier: %s\n", yytext); }
"="           { printf("Operator: =\n"); }
"=="          { printf("Operator: ==\n"); }
"+"           { printf("Operator: +\n"); }
"-"           { printf("Operator: -\n"); }
"*"           { printf("Operator: *\n"); }
"/"           { printf("Operator: /\n"); }
";"           { printf("Semicolon: ;\n"); }
[ \t\n\r]     { /* Ignore whitespace */ }
.             { printf("Unknown character: %s\n", yytext); }
%%

int main() {
    yylex();  // Start the lexical analysis
    return 0;
}

