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