fork download
  1. %{
  2. #include<stdio.h>
  3. int count=0;
  4. %}
  5. start \/\*
  6. end \*\/
  7. %%
  8. [ \n\t]+ {count++,fprintf(yyout, "$");}
  9. . { fprintf(yyout, "%s", yytext); }
  10. \/\/(.*) ;
  11. {start}.*{end} ;
  12. %%
  13. int yywrap()
  14. {
  15. return 1;
  16. }
  17. int main(void)
  18. {
  19. yyin=fopen("input.txt","r");
  20. yyout=fopen("output.c","w");
  21. yylex();
  22. printf("\nNo. of whitespace character=%d\n", count);
  23. return 0;}
  24.  
Success #stdin #stdout #stderr 0.02s 6916KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/fnkSWO/prog:2:1: Syntax error: Operator expected
ERROR: /home/fnkSWO/prog:23:10: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit