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