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