X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=cockney.l;h=f6d0ad202958460041f56bb34a2264b86406019f;hb=001ffaa6345dc499352798f29a2d0fffe4973c39;hp=823af7e98d609d3067590a7c72799d1ce5580c04;hpb=7f4e9d5ed94ae3d89fa2548194ef0bf190368080;p=filters.git diff --git a/cockney.l b/cockney.l index 823af7e..f6d0ad2 100644 --- a/cockney.l +++ b/cockney.l @@ -16,6 +16,20 @@ EW [ \t.,;!\?$] %Start junk %% + +%{ + void eos() { + if (yytext[yyleng-1] == '.') + dintI(); + else + unput(yytext[yyleng-1]); + } + + void plastc() { + unput(yytext[yyleng-1]); + } +%} + . { srandom(time(0L)); unput(yytext[0]); BEGIN 0; } {BW}[Tt]he{EW} { ECHO; bloody(); } {BW}[Ss]teal{EW} { printf("%c%cick",yytext[0],yytext[1]-5); @@ -89,29 +103,6 @@ ime{EW} { printf("oime"); eos(); } %% -eos() -{ - if (yytext[yyleng-1] == '.') - dintI(); - else - yyunput(yytext[yyleng-1], yytext); -} - -plastc() -{ - yyunput(yytext[yyleng-1], yytext); -} - -main() -{ - yylex(); -} - -int yywrap() -{ - return 1; -} - caseify(c) char c; {