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