fork download
  1. %{
  2.  
  3. #include<stdio.h>
  4. int Upper=0;
  5. int Lower=0;
  6. %}
  7.  
  8. %%
  9. [A-Z] {printf("Uppercase\t");Upper++;}
  10. [a-z] {printf("Lowercase\t");Lower++;}
  11. %%
  12.  
  13. int yywrap()
  14. {
  15. return 1;
  16. }
  17.  
  18. main()
  19. {
  20. printf("Enter a string\n");
  21. yylex();
  22.  
  23. printf("Uppercase=%d and Lowercase=%d",Upper,Lower);
  24. }
  25.  
Success #stdin #stdout #stderr 0.02s 7128KB
stdin
xdxddx
stdout
Standard output is empty
stderr
ERROR: /home/omiHSS/prog:24:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit