fork download
  1. %{
  2. #include<stdio.h>
  3. int vcount=0;
  4. int ccount=0;
  5. %}
  6.  
  7. %%
  8. [aeiouAEIOU] {vcount++;}
  9. [a-zA-Z] {ccount++;}
  10. . {}
  11. %%
  12. int main()
  13. {
  14. printf("enter any input\n");
  15. yylex();
  16. printf("the number of vowels are %d",vcount);
  17. printf("the number of consonants are %d",ccount);
  18. return 0;
  19. }
  20. int yywrap()
  21. {
  22. return 1;
  23. }
Success #stdin #stdout #stderr 0.02s 6788KB
stdin
hello aeio umsv 
stdout
Standard output is empty
stderr
ERROR: /home/XHUM7b/prog:2:2: Syntax error: Operator expected
ERROR: /home/XHUM7b/prog:23:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit