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