%{
void display(int, char *);
int flag;
%}
%%
[a|e|i|o|u]+ {
flag = 1;
display(flag, yytext);
}
. {
flag = 0;
display(flag, yytext);
}
%%
void main()
{
printf
("\nEnter a character to check whether it
is vowel or NOT\n"
); yylex();
}
void display(int flag, char *t)
{
if(flag==1)
printf("\nThe given character %s is a vowel\n", t);
else
printf("\nThe given character %s not is a vowel\n", t);
}
JXsKdm9pZCBkaXNwbGF5KGludCwgY2hhciAqKTsKaW50IGZsYWc7CiV9CgoKJSUKW2F8ZXxpfG98dV0rIHsKCWZsYWcgPSAxOwoJZGlzcGxheShmbGFnLCB5eXRleHQpOwoJfQouICAgICAgIHsKCQlmbGFnID0gMDsKCQlkaXNwbGF5KGZsYWcsIHl5dGV4dCk7Cn0KCgolJQoKCnZvaWQgbWFpbigpCnsKCXByaW50ZigiXG5FbnRlciBhIGNoYXJhY3RlciB0byBjaGVjayB3aGV0aGVyIGl0IGlzIHZvd2VsIG9yIE5PVFxuIik7Cgl5eWxleCgpOwp9CgoKdm9pZCBkaXNwbGF5KGludCBmbGFnLCBjaGFyICp0KQp7CglpZihmbGFnPT0xKQoJCXByaW50ZigiXG5UaGUgZ2l2ZW4gY2hhcmFjdGVyICVzIGlzIGEgdm93ZWxcbiIsIHQpOwoJZWxzZQoJCXByaW50ZigiXG5UaGUgZ2l2ZW4gY2hhcmFjdGVyICVzIG5vdCBpcyBhIHZvd2VsXG4iLCB0KTsKfQo=