fork download
  1. %{
  2. #include<stdio.h>
  3. int words = 0;
  4. %}
  5.  
  6. %%
  7. [ ]+ ;
  8. [a-zA-Z]+ { words++; }
  9. \n ;
  10. %%
  11.  
  12. int yywrap()
  13. {
  14. return 1;
  15. }
  16.  
  17. int main()
  18. {
  19. yylex();
  20. printf("Total words = %d\n" , words);
  21. return 0;
  22. }
Success #stdin #stdout #stderr 0.02s 6920KB
stdin
Student good morning. 
stdout
Standard output is empty
stderr
ERROR: /home/vstlfA/prog:22:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit