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