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