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