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