fork download
  1. %{
  2. #include <stdio.h>
  3. int cint = 0;
  4. int cvowel = 0;
  5. int cconsonant = 0;
  6. %}
  7.  
  8. %%
  9. [aeiouAEIOU] {printf("Valid vowel\n");cvowel++;}
  10. [0-9] {printf("Valid num\n");cint++;}
  11. .* printf("Valid consonant\n");cconsonant++;
  12. %%
  13.  
  14. int yywrap() {
  15.  
  16. return 1;
  17.  
  18. }
  19.  
  20. int main() {
  21. yylex();
  22. printf("%d %d %d\n", cint, cvowel, cconsonant);
  23. return 0;
  24.  
  25. }
Success #stdin #stdout #stderr 0.03s 6948KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/ktYQRw/prog:25:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit