fork download
  1. %{
  2. #include <stdio.h>
  3. int lower = 0, upper = 0, mixed = 0;
  4. %}
  5.  
  6. %%
  7. [a-z]+ { lower++; }
  8. [A-Z]+ { upper++; }
  9. .+ {mixed++;}
  10.  
  11. int main() {
  12. yylex();
  13. printf("Lower = %d, Upper = %d, Mixed = %d\n", lower, upper, mixed);
  14. return 0;
  15. }
  16.  
  17. int yywrap() {
  18. return 1;
  19. }
  20.  
Success #stdin #stdout #stderr 0.04s 6936KB
stdin
hello my NAME is Kshitj
stdout
Standard output is empty
stderr
ERROR: /home/zw64n6/prog:19:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit