%{
%}
%s SM SMBG
%%
# BEGIN(SM);
## BEGIN(SMBG);
[0-9]+ {
printf("\n It's a Digit ");
}
<SMBG>[A-Z]+ { printf("\n String contains upper case letters ");
}
<SM>. {
printf("\n Exiting from # start condition ");
BEGIN(INITIAL);
}
<SM,SMBG>[a-z]+ {
printf("\n String contains lower case letters ");
}
<SMBG>.+ {
printf("\n Exiting from ## start condition ");
}
.+ {
printf("\n No action to execute ");
}
%%
void main()
{
yylex();
}
int yywrap()
{
return 1;
}
JXsKIAolfQolcyBTTSBTTUJHIAolJQojIEJFR0lOKFNNKTsKIyMgQkVHSU4oU01CRyk7ClswLTldKyB7CiBwcmludGYoIlxuIEl0J3MgYSBEaWdpdCAiKTsKIH0gCjxTTUJHPltBLVpdKyB7IHByaW50ZigiXG4gU3RyaW5nIGNvbnRhaW5zIHVwcGVyIGNhc2UgbGV0dGVycyAiKTsKIH0gCjxTTT4uIHsKcHJpbnRmKCJcbiBFeGl0aW5nIGZyb20gIyBzdGFydCBjb25kaXRpb24gIik7IAogQkVHSU4oSU5JVElBTCk7CiB9IAo8U00sU01CRz5bYS16XSsgewogcHJpbnRmKCJcbiBTdHJpbmcgY29udGFpbnMgbG93ZXIgY2FzZSBsZXR0ZXJzICIpOyAKIH0gCjxTTUJHPi4rIHsKcHJpbnRmKCJcbiBFeGl0aW5nIGZyb20gIyMgc3RhcnQgY29uZGl0aW9uICIpOyAKIH0gCi4rIHsKIHByaW50ZigiXG4gTm8gYWN0aW9uIHRvIGV4ZWN1dGUgIik7IAogfSAKIAolJQp2b2lkIG1haW4oKQp7IAp5eWxleCgpOyAKfSAKaW50IHl5d3JhcCgpCnsgCnJldHVybiAxOwp9IAo=