fork download
  1. %{
  2. int len=0,counter=0;
  3. %}
  4. %%
  5. [a-zA-Z]+{
  6. len=strlen(yytext);
  7. if(len<10 && len>5)
  8. {counter++;}}
  9. %%
  10. int yywrap(void)
  11. {
  12. return 1;
  13. }
  14. int main()
  15. {
  16. printf("Enter the string:");
  17. yylex();
  18. printf("\n%d",counter);
  19. returnĀ 0;
  20. }
Success #stdin #stdout #stderr 0.02s 6892KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/KGRgAv/prog:20:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit