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