fork download
  1. %{
  2. #include <stdio.h>
  3. int letters = 0, digits = 0, special = 0;
  4. %}
  5.  
  6. %%
  7. [a-zA-Z] { letters++; }
  8. [0-9] { digits++; }
  9. [^a-zA-Z0-9\n] { special++; }
  10. %%
  11. int main() {
  12. yylex();
  13. printf("Letters: %d\n", letters);
  14. printf("Digits: %d\n", digits);
  15. printf("Special characters: %d\n", special);
  16. return 0;
  17. }
Success #stdin #stdout #stderr 0.02s 6872KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/6qhhoR/prog:17:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit