X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=cockney.l;h=4cc1555dc2ff75c9096bba477586bd997258fc23;hb=89c1b3d2e82c695eb0f16c22671f048c040a09ed;hp=823af7e98d609d3067590a7c72799d1ce5580c04;hpb=7f4e9d5ed94ae3d89fa2548194ef0bf190368080;p=filters.git diff --git a/cockney.l b/cockney.l index 823af7e..4cc1555 100644 --- a/cockney.l +++ b/cockney.l @@ -15,7 +15,15 @@ EW [ \t.,;!\?$] %Start junk +%option noyywrap + %% + +%{ +void eos(); +void plastc(); +%} + . { 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,27 +97,17 @@ ime{EW} { printf("oime"); eos(); } %% -eos() +void eos() { if (yytext[yyleng-1] == '.') - dintI(); + dintI(); else - yyunput(yytext[yyleng-1], yytext); -} - -plastc() -{ - yyunput(yytext[yyleng-1], yytext); -} - -main() -{ - yylex(); + unput(yytext[yyleng-1]); } -int yywrap() +void plastc() { - return 1; + unput(yytext[yyleng-1]); } caseify(c)