fork download
  1. %{
  2. #include <stdio.h>
  3. #include <ctype.h>
  4. %}
  5.  
  6. %%
  7. [a-z] { printf("%c", toupper(yytext[0])); }
  8. [A-Z] { printf("%c", tolower(yytext[0])); }
  9. .|\n { printf("%c", yytext[0]); }
  10. %%
  11. int yywrap()
  12. {
  13. return 1;
  14. }
  15. int main()
  16. {
  17. printf("Enter a string: ");
  18. yylex();
  19. return 0;
  20. }
  21.  
Success #stdin #stdout #stderr 0.02s 6884KB
stdin
abc
stdout
Standard output is empty
stderr
ERROR: /home/uDO7dR/prog:20:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit