Initial revision
[filters.git] / moo.l
1 %e 2000
2 %p 5000
3 %n 1000
4 %k 500
5 %a 4000
6 %o 2000
7 BW [ ]
8 EW [ .,;!?]
9
10 %{
11 /*
12 ** The cow filter
13 ** by Benjamin Elijah Griffin 8 May 1994
14 **
15 ** An experiment in lex written instead of a paper on Nietzsche.
16 **
17 ** compile like this:
18 ** lex moo.l
19 ** cc -o moo lex.yy.c -ll
20 ** rm lex.yy.c
21 **
22 ** use like this:
23 ** moo < infile > outfile
24 ** or
25 ** cat infile | <whatever> | moo | <whatever> > outfile
26 **
27 */
28
29 char WhAt[]="@(#)Benjamin Elijah Griffin's moo filter for cowtalk (c) 1994\n@(#)$Header: moo.l,v 1.1 94/05/08 23:37:53 bgriffin Final $"
30 ;
31
32 %}
33
34 %%
35
36 " and " printf(" moond ");
37 [Uu][Nn][Ii][Xx] printf("Moonix");
38 [Mm][Ss].[Dd][Oo][Ss] printf("Moo Dos");
39 news printf("moos");
40 [Uu]senet printf("Moosnet");
41 " man " printf(" mooster ");
42 " men " printf(" moosters ");
43 woman printf("moostress");
44 women printf("moostresses");
45 pig printf("cop");
46 [Dd]airy.[Ff]armer printf("Pimp");
47 [Dd]airy.[Ff]arm printf("Farm of Ill Repute");
48 [Bb]eef.[Ff]armer printf("Slave Driver");
49 [Bb]eef.[Ff]arm printf("Prison");
50 yogurt printf("bacteria culture");
51 cheese printf("smega");
52 curds printf("moist smega");
53 whey printf("bile");
54 buttermilk printf("foul fluid");
55 butter { printf("sphinter lubrication");
56 /* A _Last Tango in Paris_ joke */ }
57 cream printf("honey");
58 beef printf("murdered meat");
59 grass printf("gourmet greenry");
60 hay printf("subsistance rations");
61 cereal printf("fomood");
62 milkmaid printf("rapist");
63 [Mm]aid.a.milkin |
64 [Mm]aid.a.milking printf("Christmas Rapist");
65 [Mm]aids.a.milkin |
66 [Mm]aids.a.milking printf("Christmas Rapists");
67 milking printf("rape");
68 rape printf("milking");
69 rapist printf("milkmaid");
70 veal printf("the devil's food");
71 "bull fighter" printf("Grim Reaper");
72 "bull fight" printf("Game of Sorrows");
73 milk printf("mead");
74 Milk printf("Mead");
75 "cafe con latte" |
76 capuccino printf("piss water");
77 " "[In]"ndia " printf("Heaven");
78 " "[In]"ndian " printf("heavenly");
79 "sacred cow" printf("God");
80 silo printf("calfeteria");
81 divin printf("bovin");
82 [Gg][Oo-][Dd] printf("Bovinity");
83 sheep printf("dog(s)");
84 relaxing printf("chewing the cud");
85 relax printf("chew the cud");
86 utter printf("udder");
87 " udder" printf(" teat");
88 " teat" printf(" udder");
89 other printf("udder");
90 ":^)" printf("Mooooooooo!");
91 ":-)" printf("Moomoomoomoo!");
92 "8-)" printf("Mooo! Mooo!");
93
94 [aeiou]"." { *(yytext+1) = 0;
95 printf("%s. Moo.",yytext);
96 }
97 [rtpwy]"." { *(yytext+1) = 0;
98 printf("%s. Moo! Moo.",yytext);
99 }
100 "?" printf("? Moo.");
101 "!" printf("! MOO!");
102 oo printf("MOO");
103 o printf("oo");
104 O printf("Moo");
105 you printf("moo");
106 " u" printf("moo");
107 " U" printf("Moo");
108 "uu" printf("MOOO");
109 u printf("oo");
110 U printf("Oo");
111
112 "."\n printf(".\nMooooo. ");
113
114 . printf("%s",yytext);
115
116 %%
117
118 main()
119 {
120 yylex();
121 }
122
This page took 0.024319 seconds and 4 git commands to generate.