%{
#include <stdio.h>
int spaces = 0;
int chars = 0;
int words = 0;
%}
%%
" " { spaces++; chars++; }
[ \t\n] { chars++; }
[a-zA-Z0-9]+ { words++; chars += yyleng; }
. { chars++; }
%%
int main()
{
yylex();
printf("Spaces : %d\n", spaces);
printf("Words : %d\n", words);
printf("Characters : %d\n", chars);
return 0;
}
int yywrap()
{
return 1;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgc3BhY2VzID0gMDsKaW50IGNoYXJzICA9IDA7CmludCB3b3JkcyAgPSAwOwolfQoKJSUKIiAiICAgICAgICB7IHNwYWNlcysrOyBjaGFycysrOyB9ClsgXHRcbl0gICAgeyBjaGFycysrOyB9ClthLXpBLVowLTldKyB7IHdvcmRzKys7IGNoYXJzICs9IHl5bGVuZzsgfQouICAgICAgICAgIHsgY2hhcnMrKzsgfQolJQoKaW50IG1haW4oKQp7Cnl5bGV4KCk7CnByaW50ZigiU3BhY2VzICAgICA6ICVkXG4iLCBzcGFjZXMpOwpwcmludGYoIldvcmRzICAgICAgOiAlZFxuIiwgd29yZHMpOwpwcmludGYoIkNoYXJhY3RlcnMgOiAlZFxuIiwgY2hhcnMpOwpyZXR1cm4gMDsKfQoKaW50IHl5d3JhcCgpCnsKICAgIHJldHVybiAxOwp9Cg==