fork download
  1. %option noyywrap
  2. %{
  3. #include<stdio.h>
  4. %}
  5.  
  6. %%
  7. [0-9]num++;
  8. ECHO;
  9. %%
  10. main(void)
  11. {
  12. yyin =fopen("practical_10.txt","r");yylex();
  13. printf("\n%d digits",num);
  14. }
  15. int yywrap()
  16. {
  17. return (1);
  18. }
Success #stdin #stdout #stderr 0.02s 6960KB
stdin
221325
2125
stdout
Standard output is empty
stderr
ERROR: /home/VUfsBJ/prog:18:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit