fork download
  1. %{
  2. #include <stdio.h>
  3.  
  4. int vowels = 0;
  5. int consonants = 0;
  6. %}
  7.  
  8. %%
  9. [AaEeIiOoUu] {vowels++;}
  10. [A-Za-z] {consonants++;}
  11. . {}
  12. \n {printf("Vowels: %d\nConsonants: %d\n", vowels, consonants); return 0;}
  13. %%
  14.  
  15. int main() {
  16. yylex();
  17. return 0;
  18. }
  19.  
Success #stdin #stdout #stderr 0.02s 6780KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/TnAYHB/prog:2:1: Syntax error: Operator expected
ERROR: /home/TnAYHB/prog:18:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit