fork download
  1. %{
  2. #include<stdio.h>
  3. int pc=0, sc=0;
  4. %}
  5. %%
  6. “printf” { fprintf(yyout,”writef”); pc++;}
  7. “scanf” { fprintf(yyout,”readf”); sc++;}
  8. %%
  9. int yywrap()
  10. {
  11. return 1;
  12. }
  13. main()
  14. {
  15. yyin=fopen(“input.txt”,”r”);
  16. yyout=fopen(“output.txt,”w”);
  17. yylex();
  18. printf(“No of printf statements = %d\n No of scanf statements=%d\n”, pc, sc);
  19. }
Success #stdin #stdout #stderr 0.02s 7032KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/lV1vwL/prog:19:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit