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