fork download
  1. %{
  2. /* Definitions */
  3. int vowels = 0;
  4. int consonants = 0;
  5. %}
  6.  
  7. %%
  8. /* Rules */
  9. [aAeEiIoOuU] { vowels++; }
  10. [A-Za-z] { consonants++; }
  11. . ; /* Ignore all other characters */
  12. %%
  13.  
  14. int yywrap() {
  15. printf("Total Vowels: %d\n", vowels);
  16. printf("Total Consonants: %d\n", consonants);
  17. return 1;
  18. }
  19.  
  20. int main() {
  21. yylex();
  22. return 0;
  23. }
  24.  
Success #stdin #stdout #stderr 0.03s 6928KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/V44Cnm/prog:3:4: Syntax error: Operator expected
ERROR: /home/V44Cnm/prog:23:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit