fork download
  1. %{
  2. #include <stdio.h>
  3. #include <ctype.h>
  4. %}
  5.  
  6. %%
  7.  
  8. [a-z]+ {
  9. int i;
  10. for(i = 0; yytext[i] != '\0'; i++)
  11. yytext[i] = toupper(yytext[i]);
  12.  
  13. printf("%s", yytext);
  14. }
  15.  
  16. [ \t\n]+ { printf("%s", yytext); }
  17.  
  18. %%
  19.  
  20. int main(int argc, char *argv[])
  21. {
  22. if(argc > 1)
  23. yyin = fopen(argv[1], "r");
  24.  
  25. yylex();
  26. return 0;
  27. }
  28.  
Success #stdin #stdout #stderr 0.02s 6908KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/jY4SI4/prog:27:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit