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