fork download
  1. %{
  2. #include <stdio.h>
  3. int symbols = 0;
  4. int words = 1;
  5. %}
  6. word [.^\ \']*
  7. symbol [\!\@\#\$\%\^\&\*\(\)\-\_\=\+\|\\\/\<\>\:\;\"\'\`\~\{\}\[\]\.]
  8. %%
  9. {word} { words++; }
  10. {symbol} { symbols++; }
  11. %%
  12. int main() {
  13. yylex();
  14. printf("%d %d", symbols, words);
  15. return 0;
  16. }
  17.  
  18. int yywrap() { return 1; }
Success #stdin #stdout #stderr 0.02s 6904KB
stdin
Test'test test
stdout
Standard output is empty
stderr
ERROR: /home/RRw8P1/prog:2:3: Syntax error: End of file in quoted atom
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit