fork download
  1. %{
  2. #include<stdio.h>
  3. int count=0;
  4. %}
  5.  
  6.  
  7. %%
  8. [\t] {count++;}
  9. [\n] {count++;}
  10. "\\" {count++;}
  11. %%
  12.  
  13. int yywrap()
  14. {
  15. return 1;
  16. }
  17.  
  18.  
  19. int main()
  20. {
  21. printf("Enter a string : ");
  22. yylex();
  23. printf("Count : %d",count);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout #stderr 0.02s 6904KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/UEL3g5/prog:25:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit