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