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