fork download
  1. %{
  2. #include <stdio.h> int vowels = 0, consonants = 0;
  3. %}
  4. %%
  5. [aeiouAEIOU] { vowels++; }
  6. [a-zA-Z] { consonants++; }
  7. . { /* ignore */ }
  8. %%
  9.  
  10. int yywrap() { return 1; }
  11.  
  12. int main() { printf("Enter text (Ctrl+Z to end):\n"); yylex(); printf("Vowels: %d\nConsonants: %d\n", vowels, consonants);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout #stderr 0.03s 6864KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/NM1hfk/prog:2:1: Syntax error: Operator expected
ERROR: /home/NM1hfk/prog:14:2: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit