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