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