fork download
  1. %{
  2. int flag=0;
  3. %}
  4. %%
  5. [(] {flag++;}
  6. [)] {flag--;}
  7. [\n] {if(flag==0)
  8. printf("\t Well formed parathensis"); else if(flag>0)
  9. printf("\t Closing parathens missing"); else
  10. printf("\topening parathens missing");
  11. }
  12. %%
  13.  
  14. int main(void)
  15. {
  16. printf("enter the expression"); yylex();
  17. return(0);
  18. }
  19. int yywrap(void)
  20. {
  21. return 0;
  22. }
  23. int yyerror(void)
  24. {
  25. printf("Error\n"); exit(1);
  26. }
Success #stdin #stdout #stderr 0.04s 6924KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/cEVtmu/prog:26:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit