%{
#include <stdio.h>
#include <stdlib.h>
int vowel_count = 0;
int consonant_count = 0;
%}
%option noyywrap
%%
// Match vowels (both uppercase and lowercase)
[aeiouAEIOU] { vowel_count++; }
// Match consonants (both uppercase and lowercase)
[b-df-hj-np-tv-zB-DF-HJ-NP-TV-Z] { consonant_count++; }
// Ignore whitespace and punctuation
[ \t\n] ; // Ignore whitespace
. ; // Ignore any other character
%%
// Main function
int main(int argc, char **argv) {
yylex(); // Start the lexer
printf("Total Vowels: %d\n", vowel_count);
printf("Total Consonants: %d\n", consonant_count);
return 0;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCB2b3dlbF9jb3VudCA9IDA7CmludCBjb25zb25hbnRfY291bnQgPSAwOwolfQoKJW9wdGlvbiBub3l5d3JhcAoKJSUKCi8vIE1hdGNoIHZvd2VscyAoYm90aCB1cHBlcmNhc2UgYW5kIGxvd2VyY2FzZSkKW2FlaW91QUVJT1VdICAgeyB2b3dlbF9jb3VudCsrOyB9CgovLyBNYXRjaCBjb25zb25hbnRzIChib3RoIHVwcGVyY2FzZSBhbmQgbG93ZXJjYXNlKQpbYi1kZi1oai1ucC10di16Qi1ERi1ISi1OUC1UVi1aXSB7IGNvbnNvbmFudF9jb3VudCsrOyB9CgovLyBJZ25vcmUgd2hpdGVzcGFjZSBhbmQgcHVuY3R1YXRpb24KWyBcdFxuXSAgICAgICAgOyAvLyBJZ25vcmUgd2hpdGVzcGFjZQouICAgICAgICAgICAgICA7IC8vIElnbm9yZSBhbnkgb3RoZXIgY2hhcmFjdGVyCgolJQoKLy8gTWFpbiBmdW5jdGlvbgppbnQgbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpIHsKICAgIHl5bGV4KCk7IC8vIFN0YXJ0IHRoZSBsZXhlcgogICAgcHJpbnRmKCJUb3RhbCBWb3dlbHM6ICVkXG4iLCB2b3dlbF9jb3VudCk7CiAgICBwcmludGYoIlRvdGFsIENvbnNvbmFudHM6ICVkXG4iLCBjb25zb25hbnRfY291bnQpOwogICAgcmV0dXJuIDA7Cn0=