Initial revision
[filters.git] / ken.l
CommitLineData
7e3afbba 1%{
2/*
3 * ken:
4 * will turn English into Cockney, featuring (dubious) rhyming slang for a lot
5 * of computer terminology.
6 *
7 * Written by Stephen K Mulrine <smulrine%cs.strath.ac.uk@nsfnet-relay.ac.uk>
8 * Make copies if you want etc.etc.
9 *
10 * ken is named after Ken the Chirpy Cockney Character from the Viz Comic (tm),
11 * who speaks somewhat like that.
12 */
13%}
14%e 3000
15%p 6000
16%n 1000
17%k 500
18%a 4000
19%o 2000
20BW [ ]
21EW [ .,;!?]
22%{
23 char buf[128];
24%}
25
26%%
27
28stairs printf("apples and pears");
29Downstairs printf("Down the apples and pears");
30downstairs printf("down the apples and pears");
31Upstairs printf("Up the apples and pears");
32upstairs printf("up the apples and pears");
33[Mm]outh printf("North and South");
34[Ff]ace printf("Boat Race");
35[Tt]rouble printf("Barney Rubble");
36wife { switch(rand()%2)
37 {
38 case 0: printf("trouble and strife"); break;
39 case 1: printf("ole lady"); break;
40 }
41 }
42Road printf("Frog and Toad");
43" road" printf(" frog and toad");
44"pub " printf("rub-a-dub ");
45" bar " printf(" boozer ");
46" husband" printf(" ole man");
47Party printf("Knees-up");
48party printf("knees-up");
49Parties printf("Knees-ups");
50parties printf("knees-ups");
51My printf("Me");
52" my" printf(" me");
53Your printf("Yer");
54your printf("yer");
55"You are " printf("Yer ");
56"you are " printf("yer ");
57You printf("Yer");
58you printf("yer");
59Those printf("Them");
60those printf("them");
61" those" printf(" them");
62"(those" printf("(them");
63"The " { switch(rand()%5)
64 {
65 case 0: printf("The bleedin' "); break;
66 default: ECHO; break;
67 }
68 }
69"The" ECHO;
70" the " { switch(rand()%5)
71 {
72 case 0: printf(" the bleedin' "); break;
73 default: ECHO; break;
74 }
75 }
76[" "(]the ECHO;
77"the " { switch(rand()%5)
78 {
79 case 0: printf(" the bleedin' "); break;
80 default: ECHO; break;
81 }
82 }
83[Tt]his ECHO;
84[" "(]this ECHO;
85[Tt]hat ECHO;
86[" "(]that ECHO;
87Thus printf("So");
88" thus" printf(" so");
89"(thus" printf("(so");
90"thus" printf("so");
91[Tt]han ECHO;
92[" "(]than ECHO;
93Who ECHO;
94who ECHO;
95" old " printf(" ole ");
96" to " printf(" ter ");
97"Aren't you " printf("Aintcha ");
98"aren't you " printf("aintcha ");
99"Aren't" printf("Ain't");
100"aren't" printf("ain't");
101"Isn't" printf("Ain't");
102"isn't" printf("ain't");
103"Are not " printf("Ain't");
104"are not " printf("ain't ");
105"Is not " printf("Ain't ");
106" is not " printf(" ain't ");
107"What is th" printf("Woss");
108"what is th" printf("woss");
109"What are you " printf("Wotcher ");
110"what are you " printf("wotcher ");
111"What you are" printf("Wotcher");
112"what you are" printf("wotcher");
113"What you're" printf("Wotcher");
114"what you're" printf("wotcher");
115"What are your" printf("Wotcher");
116"what are your" printf("wotcher");
117"What do you " printf("Wotcher ");
118"what do you " printf("wotcher ");
119"What do your" printf("Wotcher");
120"what do your" printf("wotcher");
121" "H[aeu]llo printf(" Wotcher");
122" "h[aeu]llo printf(" wotcher");
123What printf("Wot");
124what printf("wot");
125Were printf("Was");
126were printf("was");
127Bother printf("Ars");
128bother printf("ars");
129Mother printf("Muvver");
130Other printf("Uvver");
131other printf("uvver");
132Father printf("Favver");
133father printf("favver");
134Rather printf("Ravver");
135rather printf("ravver");
136Weather printf("Wevver");
137weather printf("wevver");
138Leather printf("Levver");
139leather printf("levver");
140Wither printf("Wivver");
141wither printf("wivver");
142Either printf("Eever");
143either printf("eever");
144With printf("Wiv");
145with printf("wiv");
146Anything printf("Anyfink");
147anything printf("anyfink");
148Something printf("Sumfink");
149something printf("sumfink");
150Nothing printf("Nuffink");
151nothing printf("nuffink");
152guitars printf("spoons");
153guitar printf("spoons");
154drums printf("spoons");
155drum printf("spoons");
156trumpets printf("spoons");
157trumpet printf("spoons");
158violins printf("spoons");
159violin printf("spoons");
160clarinets printf("spoons");
161clarinet printf("spoons");
162trombones printf("spoons");
163trombone printf("spoons");
164oboes printf("spoons");
165oboe printf("spoons");
166flutes printf("spoons");
167flute printf("spoons");
168tubas printf("spoons");
169tuba printf("spoons");
170Data printf("Info");
171data printf("info");
172Directory printf("Lockup");
173directory printf("lockup");
174Directories printf("Lockups");
175directories printf("lockups");
176[Pp]rocess { switch(rand()%2)
177 {
178 case 0: printf("Queen Bess"); break;
179 case 1: printf("Rudolf 'Ess"); break;
180 }
181 }
182[Cc]omputer printf("French Tutor");
183[Bb]yte printf("Jimmy White");
184[Ff]iles printf("Nobby Stiles");
185[Ff]ile printf("Royal Mile");
186[Ll]anguage printf("'Am Sandwich");
187[Zz]ero printf("Emperor Nero");
188[Jj]ob printf("Uncle Bob");
189[Ss]hell printf("Bow Bell");
190[Ss]ave printf("Chas'n'Dave");
191[Ll]oad printf("Old Kent Road");
192[Mm]ouse printf("Doll's 'Ouse");
193[Bb]uffer printf("Sausage Stuffer");
194[Kk]eyboard printf("Henry Ford");
195[Mm]anual printf("Cocker Spaniel");
196[Ss]creen printf("James Dean");
197[Pp]rinter printf("'Arold Pinter");
198[Pp]lotter printf("Pansy Potter");
199[Cc]ompiler printf("Martin Tyler");
200[Ss]tring printf("Emperor Ming");
201[Bb]rain printf("Michael Caine");
202[Pp][Aa][Ss][Cc][Aa][Ll] { switch(rand()%2)
203 {
204 case 0: printf("Pall Mall"); break;
205 case 1: printf("Roald Dahl"); break;
206 }
207 }
208[Aa][Ll][Gg][Oo][Ll] printf("Johnny Ball");
209[Ff][Oo][Rr][Tt][Rr][Aa][Nn] printf("Manfred Mann");
210[Cc][Oo][Bb][Oo][Ll] printf("Albert Hall");
211Stopped printf("'Ad the mockers put on");
212stopped printf("'ad the mockers put on");
213Stopping printf("Putting the mockers on");
214stopping printf("putting the mockers on");
215stops printf("puts the mockers on");
216stop printf("put the mockers on");
217STOP printf("Put The Mockers On");
218[Ll]ondoner printf("Cockney");
219friend { switch(rand()%3)
220 {
221 case 0: printf("mucker"); break;
222 case 1: printf("mate"); break;
223 case 2: printf("china"); break;
224 }
225 }
226"a h" printf("an '");
227"A h" printf("An '");
228" h" printf(" '");
229" H" printf(" '");
230" C-" printf(" Bruce Lee-");
231" C " { switch(rand()%4)
232 {
233 case 0: printf(" Bruce Lee "); break;
234 case 1: printf(" Circus Flea "); break;
235 case 2: printf(" Bumble Bee "); break;
236 case 3: printf(" Door Key "); break;
237 }
238 }
239" C." printf(" Circus Flea.");
240Th printf("F");
241Wh printf("W");
242wh printf("w");
243aw printf("or");
244" sing" ECHO;
245" ring" ECHO;
246"ing " printf("in' ");
247" th" printf(" f");
248"th" printf("ff");
249". " { switch(rand()%32)
250 {
251 case 0: printf(". I'll get out me spoons. "); break;
252 case 1: printf(". Yer can't 'ave a knees-up wivout a joanna. "); break;
253 case 2: printf(". Cor blimey guv, would I lie to you. "); break;
254 case 3: printf(". I'll make us all a nice cup of tea. "); break;
255 default: ECHO; break;
256 }
257 }
258"? " { switch(rand()%3)
259 {
260 case 0: printf(", mate? "); break;
261 case 1: printf(", guv? "); break;
262 case 2: printf(", squire? "); break;
263 }
264 }
265"! " { switch(rand()%6)
266 {
267 case 0: printf(", cor blimey! "); break;
268 case 1: printf("! Struth! "); break;
269 case 2: printf(", guv! "); break;
270 case 3: printf("! Honest guv! "); break;
271 case 4: printf(", mate! "); break;
272 case 5: ECHO; break;
273 }
274 }
275. printf(yytext);
276\n printf("\n");
277%%
278
279main()
280{
281 srand(getpid());
282 yylex();
283}
This page took 0.025779 seconds and 4 git commands to generate.