#include<stdio.h>
int count=0;
%%
[a-z] {}
[A-Z] {}
[0-9] {}
[')'] {count++;}
['('] {count--;}
[+/%<>$] {}
['\n'] {
if(count==0)
printf
("parenthesis
is matched\n"
); else if(count > 0)
printf("presence of unmatched right parenthesis\n");
else
printf("presence of unmatched left parenthesis\n");
}
%%
int main () {
printf("Enter the expression: ");
yylex();
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KaW50IGNvdW50PTA7CiUlClthLXpdIHt9CltBLVpdIHt9ClswLTldIHt9ClsnKSddIHtjb3VudCsrO30KWycoJ10ge2NvdW50LS07fQpbKy8lPD4kXSB7fQpbJ1xuJ10gewppZihjb3VudD09MCkKcHJpbnRmKCJwYXJlbnRoZXNpcyBpcyBtYXRjaGVkXG4iKTsKIGVsc2UgaWYoY291bnQgPiAwKQpwcmludGYoInByZXNlbmNlIG9mIHVubWF0Y2hlZCByaWdodCBwYXJlbnRoZXNpc1xuIik7CiBlbHNlCnByaW50ZigicHJlc2VuY2Ugb2YgdW5tYXRjaGVkIGxlZnQgcGFyZW50aGVzaXNcbiIpOwp9CiUlCmludCBtYWluICgpIHsKcHJpbnRmKCJFbnRlciB0aGUgZXhwcmVzc2lvbjogIik7Cnl5bGV4KCk7CnJldHVybiAwOwp9Cg==