fork download
  1. %{
  2. #include <stdio.h>
  3. int vow = 0, con = 0;
  4. %}
  5.  
  6. %%
  7. [aeiouAEIOU] { vow++; }
  8. [a-zA-Z] { con++; }
  9. %%
  10.  
  11. int yywrap() { return 1; }
  12.  
  13. int main() {
  14. printf("Enter some input: ");
  15. yylex();
  16. printf("\nNo. of vowels = %d\n", vow);
  17. printf("No. of consonants = %d\n", con);
  18. return 0;
  19. }
Success #stdin #stdout #stderr 0.03s 6816KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/D3nzVY/prog:19:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit