%{
#include<stdio.h>
#include<string.h>
#include<ctype.h>
%}
%%
[a-z,A-Z].[(\."-")]{printf("by using top down parsing the given string:%s,is satisfying the grammar",yytext)}
else if {printf("by using top down parsing the given string:%s is not satisfying the grammar",yytext)}
%%
int main(){
printf("enter the string:");
scanf('%s\n',&string);
yylex();
return 0;
}
yywrap(){
return 1;
}
JXsKCSNpbmNsdWRlPHN0ZGlvLmg+CgkjaW5jbHVkZTxzdHJpbmcuaD4KCSNpbmNsdWRlPGN0eXBlLmg+CgkKJX0KCiUlCgpbYS16LEEtWl0uWyhcLiItIilde3ByaW50ZigiYnkgdXNpbmcgdG9wIGRvd24gcGFyc2luZyB0aGUgZ2l2ZW4gc3RyaW5nOiVzLGlzIHNhdGlzZnlpbmcgdGhlIGdyYW1tYXIiLHl5dGV4dCl9CgplbHNlIGlmIHtwcmludGYoImJ5IHVzaW5nIHRvcCBkb3duIHBhcnNpbmcgdGhlIGdpdmVuIHN0cmluZzolcyBpcyBub3Qgc2F0aXNmeWluZyB0aGUgZ3JhbW1hciIseXl0ZXh0KX0KCiUlCgppbnQgbWFpbigpewoJcHJpbnRmKCJlbnRlciB0aGUgc3RyaW5nOiIpOwoJc2NhbmYoJyVzXG4nLCZzdHJpbmcpOwoJeXlsZXgoKTsKCXJldHVybiAwOwp9Cgp5eXdyYXAoKXsKCXJldHVybiAxOwp9