fork download
  1. %{
  2. #include<stdio.h>
  3. int line=0, word=0, ch=0;
  4. %}
  5. %%
  6. [a-z|A-Z|0-9] {ch++;}
  7. " " {word++;}
  8. "\n" {line++; word++;}
  9. %%
  10. int yywrap(void){}
  11. void main(int argc, char* argv[]){
  12. /*yyin = fopen(argv[1],"r");*/
  13. yylex();
  14. printf("Line = %d\n",line);
  15. printf("Word = %d\n",word);
  16. printf("Character = %d\n",ch);
  17. }
Success #stdin #stdout #stderr 0.03s 6984KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/669pIg/prog:17:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit