fork download
  1. %{
  2. #include<stdio.h>
  3. #include<string.h>
  4. int v=0,c=0;
  5. %}
  6. %%
  7. [aeiouAEIOU] {v++;}
  8. [a-zA-Z] {c++;}
  9. %%
  10. int yywrap()
  11. {
  12. return 1;
  13. }
  14. int main()
  15. {
  16. printf("enter the string: ");
  17. yylex();
  18. printf("vowels: %d\n consonats: %d", v, c);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout #stderr 0.02s 7016KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/7n2Rh0/prog:20:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit