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