%{
#include <stdio.h>
#include <stdlib.h>
int nb = 0;
int mot = 0;
int pen = 0;
%}
%option noyywrap
chiffre [0-9]
mot [a-zA-Z]+
punctuation [,:!;]
%%
{mot} { mot++; }
{punctuation}+ { pen++; }
{chiffre}+ { nb++; }
%%
int main()
{
yylex();
printf("Il y a %d mots\n", mot);
printf("Il y a %d nombres\n", nb);
printf("Il y a %d ponctuations\n", pen);
return 0;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBuYiA9IDA7CmludCBtb3QgPSAwOwppbnQgcGVuID0gMDsKJX0KCiVvcHRpb24gbm95eXdyYXAKCmNoaWZmcmUgWzAtOV0KbW90ICAgIFthLXpBLVpdKwpwdW5jdHVhdGlvbiBbLDohO10KCiUlCgp7bW90fSB7IG1vdCsrOyB9CntwdW5jdHVhdGlvbn0rIHsgcGVuKys7IH0Ke2NoaWZmcmV9KyB7IG5iKys7IH0KCiUlCgppbnQgbWFpbigpIAp7IAogICAgeXlsZXgoKTsgCiAgICBwcmludGYoIklsIHkgYSAlZCBtb3RzXG4iLCBtb3QpOwogICAgcHJpbnRmKCJJbCB5IGEgJWQgbm9tYnJlc1xuIiwgbmIpOwogICAgcHJpbnRmKCJJbCB5IGEgJWQgcG9uY3R1YXRpb25zXG4iLCBwZW4pOwogICAgcmV0dXJuIDA7Cn0K