%{
#include <stdio.h>
%}

%%
    /* Définition des tokens */
    [ \t\n]+        ; /* Ignorer les espaces, tabulations et nouvelles lignes */
    "//".*          ; /* Ignorer les commentaires monolignes */
    /\*([^*]|\*+[^*/])*\*+/    ; /* Ignorer les commentaires multilignes */
    if|else|while|return    { printf("KEYWORD: %s\n", yytext); }
    [a-zA-Z_][a-zA-Z0-9_]*  { printf("IDENTIFIER: %s\n", yytext); }
    [0-9]+                 { printf("NUMBER: %s\n", yytext); }
    \+|\-|\*|\/|=          { printf("OPERATOR: %s\n", yytext); }
    \(|\)|\{|\}|;|,        { printf("SYMBOL: %s\n", yytext); }
    .                      { printf("UNKNOWN: %s\n", yytext); }
%%

int main() {
    yylex();
    return 0;
}

int yywrap() {
    return 1;
}
