fork download
  1. %option noyywrap
  2. %{
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. int cntvowel = 0;
  6. %}
  7. vowel [AEIOUaeiou]
  8. %%
  9. {vowel} {printf("Vowel found : %s\n" , yytext);cntvowel++;}
  10. .|\n {}
  11. %%
  12. int main(){
  13. yylex();
  14. printf("No of vowels = %d\n" , cntvowel);
  15. return 0;
  16. }
Success #stdin #stdout #stderr 0.02s 7028KB
stdin
abc
stdout
Standard output is empty
stderr
ERROR: /home/dgnLw4/prog:16:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit