fork download
  1. %{
  2. int line =0, space=0, tabs=0, other=0;
  3. %}
  4.  
  5. %%
  6. /n {line++;}
  7. " " {space++}
  8. /t {tabs++;}
  9. . {other++;}
  10. %%
  11.  
  12. int main()
  13. {
  14. yylex();
  15.  
  16. printf("lines = %d", line);
  17. printf("spaces = %d", space);
  18. printf("tabs = %d", tabs);
  19. printf("other = %d", other);
  20. }
  21.  
  22. int yywrap(){
  23. return 0;
  24.  
  25. }
  26.  
Success #stdin #stdout #stderr 0.02s 6916KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/At99cx/prog:2:4: Syntax error: Operator expected
ERROR: /home/At99cx/prog:25:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit