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