fork download
  1. %{
  2. #include <stdio.h>
  3. int vowels=0,consonats=0;
  4. %}
  5.  
  6. %%
  7. [ \n\t] ;\\do nothing
  8. [aeiouAEIOU]+ {vowels++}
  9. [^aeiouAEIOU]+ {consonats++}
  10. %%
  11. int main()
  12. {
  13. printf("enter the string");
  14. yylex;
  15. printf("number of vowels are%d",voewls);
  16. printf("number of consonants are %d",consonats);
  17. }
  18. int yywrap(){
  19. return 1;
  20. }
  21.  
Success #stdin #stdout #stderr 0.03s 6912KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/TO2LTv/prog:20:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit