fork download
  1. %{
  2. #include<stdio.h>#include<string.h>
  3. int i;
  4. %}
  5.  
  6. %%
  7. [a-z A-Z]*
  8. {for(i=0;i<=yyleng;i++)
  9. {if((yytext[i]=='a')&&(yytext[i+1]=='b')&&(yytext[i+2]=='c'))
  10. {
  11. yytext[i]='A';yytext[i+1]='B';yytext[i+2]='C';
  12. }
  13.  
  14. }
  15. printf("%s",yytext);
  16.  
  17. }
  18. [\t]* return;
  19. .* {ECHO;}
  20. \n {printf("%s",yytext);}
  21. %%
  22.  
  23. int main()
  24. {
  25. yylex();
  26. }
  27.  
  28. int yywrap()
  29. {
  30. return 1;
  31. }
Success #stdin #stdout #stderr 0.03s 6912KB
stdin
abc
stdout
Standard output is empty
stderr
ERROR: /home/2F2nbm/prog:31:5: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit