fork download
  1. %{
  2. int count_vowels=0; int count_consts=0;
  3. %}
  4. %%
  5. [aeiouAEIOU] {count_vowels++;} [a-zA-z] {count_consts++;}
  6. %%
  7. int main()
  8. {
  9. printf("Enter the string \n"); yylex();
  10. printf("THe number of vowel are %d\n",count_vowels); printf("The number of consonant is %d\n",count_consts);
  11. }
  12. int yywrap()
  13. {
  14. return 1;
  15. }
  16.  
Success #stdin #stdout #stderr 0.02s 6980KB
stdin
hello hi
stdout
Standard output is empty
stderr
ERROR: /home/waNORN/prog:15:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit