* Deal with the new flex 2.5.31 as follows:
[filters.git] / jive.l
1 %{
2 /*
3 * Lex filter to transform plain English into Jive English.
4 * No racial or societal slurs are intended. For amusement only.
5 *
6 * Copyright 1986 by Daniel Klein and Clement Cole.
7 *
8 * Reproduction permitted so long as this notice is retained.
9 */
10
11 %}
12 %e 1700
13 %p 4000
14 %n 700
15 %k 450
16 %a 1700
17 %o 1500
18 BW [ \t\(]
19 EW [ \t.,;!\?$\)]
20 %%
21 @[Bb]egin(.*) |
22 ".so ".*$ printf("%s", yytext);
23 {BW}send printf("%ct'row",yytext[0]);
24 program+ printf("honky code");
25 [Uu]nix printf("slow mo-fo");
26 UNIX printf("dat slow mo-fo");
27 actual printf("ak'shul");
28 {BW}take printf("%csnatch",yytext[0]);
29 {BW}took |
30 {BW}take[ns] printf("%csnatch'd",yytext[0]);
31 [Mm]exican printf("%cet-back", caseify('w'));
32 [Ii]talian printf("%creaser", caseify('g'));
33 {BW}big{EW} { printf("%cbig ass",yytext[0]);plastc();}
34 fool printf("honkyfool");
35 modem printf("doodad");
36 {BW}he{EW} { printf("%cmah' man he",yytext[0]);plastc();}
37 "e the"{EW} |
38 "a the"{EW} |
39 "t the"{EW} |
40 "d the"{EW} { printf("%c da damn", yytext[0]);plastc();}
41 wife |
42 woman printf("mama");
43 girl printf("goat");
44 something printf("sump'n");
45 {BW}lie printf("%chonky jive",yytext[0]);
46 -o- printf("-on rebound-");
47 [a-z]"." { printf("%s", yytext);expletive();}
48 ! printf(". Right On!");
49 [Ss]ure printf("%cho'", yytext[0]);
50 get printf("git");
51 "will have"{EW} |
52 "will"{EW} |
53 "got to"{EW} { printf("gots'ta");plastc();}
54 "I am" printf("I's gots'ta be");
55 "aren't" |
56 "am not" |
57 "have not" |
58 "is not" |
59 "are not" printf("ain't");
60 {BW}see{EW} { printf("%csee's",yytext[0]);plastc();}
61 {BW}are{EW} { printf("%cis",yytext[0]);plastc();}
62 {BW}hat{EW} { printf("%cfedora",yytext[0]);plastc();}
63 {BW}shoe printf("%ckicker",yytext[0]);
64 {BW}"have to"{EW} |
65 {BW}has{EW} { printf("%cgots'ta",yytext[0]);plastc();}
66 have printf("gots'");
67 {BW}go{EW} |
68 {BW}"come over"{EW} |
69 {BW}come{EW} { printf("%cmosey on down",yytext[0]);plastc();}
70 buy printf("steal");
71 {BW}car{EW} { printf("%cwheels",yytext[0]);plastc();}
72 drive printf("roll");
73 {BW}food printf("%ccatfish an' colluhd greens",yytext[0]);
74 {BW}eat{EW} { printf("%cfeed da bud",yytext[0]);plastc();}
75 drink printf("guzzle");
76 black |
77 negro printf("brother");
78 white printf("honky");
79 nigger printf("gentleman");
80 nice printf("supa' fine");
81 {BW}person printf("%csucka'",yytext[0]);
82 [Pp]eople printf("%cucka's", caseify('s'));
83 {BW}thing thing(yytext[0]);
84 house{EW} { printf("crib");plastc();}
85 home printf("plantation");
86 name printf("dojigger");
87 {BW}path printf("%calley",yytext[0]);
88 [Cc]omputer printf("%clunker", yytext[0]);
89 or printf("o'");
90 president printf("super-dude");
91 "prime minister" printf("prahm mistah");
92 government printf("guv'ment");
93 knew printf("knowed");
94 [Bb]ecause printf("'%cuz", caseify('c'));
95 [Yy]our printf("%co'", yytext[0]);
96 [Ff]our printf("%coe", yytext[0]);
97 got printf("gots");
98 young printf("yung");
99 you printf("ya'");
100 You printf("You's");
101 first printf("fust");
102 police printf("honky pigs");
103 {BW}string printf("%cchittlin'",yytext[0]);
104 {BW}read printf("%ceyeball",yytext[0]);
105 write printf("scribble");
106 think{EW} { printf("thin'");plastc();}
107 with printf("wif");
108 other printf("uthu'");
109 [Tt]hr printf("%c'r", yytext[0]);
110 [Tt]h printf("%c", caseify('d'));
111 ing printf("in'");
112 {BW}a{EW} { printf("%csome",yytext[0]);plastc();}
113 {BW}to{EW} { printf("%ct'",yytext[0]);
114 if(yytext[yyleng-1]!=' ')
115 plastc();
116 }
117 tion printf("shun");
118 [Aa]lmost printf("%cos'", caseify('m'));
119 from printf("fum");
120 [Yy]"ou're" printf("%couse", yytext[0]);
121 alright |
122 okay printf("coo'");
123 [Aa]nd printf("%cn'", yytext[0]);
124 known printf("knode");
125 want printf("wants'");
126 beat printf("whup'ed");
127 ile printf("ah'l");
128 er{EW} { printf("uh");plastc();}
129 [a-z]sti printf("%cs'i", yytext[0]);
130 tute printf("toot");
131 exp printf("'sp");
132 exs |
133 exc printf("'s");
134 {BW}ex printf("%c'es",yytext[0]);
135 [ae]ct{EW} { printf("%cc'", yytext[0]); plastc(); }
136 like printf("likes");
137 done |
138 did printf("dun did");
139 "kind of" printf("kind'a");
140 women printf("honky chicks");
141 {BW}man{EW} { printf("%cdude",yytext[0]);plastc();}
142 {BW}men{EW} |
143 {BW}mens{EW} { printf("%cdudes",yytext[0]);plastc();}
144 injured printf("hosed");
145 killed |
146 dead printf("wasted");
147 good printf("baaaad");
148 open{EW} { printf("jimmey");plastc();}
149 opened{EW} { printf("jimmey'd");plastc();}
150 {BW}very printf("%creal",yytext[0]);
151 per printf("puh'");
152 oar printf("o'");
153 {BW}can printf("%ckin",yytext[0]);
154 {BW}just{EW} { printf("%cplum",yytext[0]);plastc();}
155 [Dd]etroit printf("Mo-town");
156 [Ww]"estern "[Ee]"lectric" printf("da' cave");
157 {BW}believe printf("%crecon'",yytext[0]);
158 [Ii]"ndianapolis" printf("Nap-town");
159 Daniel |
160 Dan printf("Liva' Lips");
161 Reagan printf("Kingfish");
162 Ronald{EW} |
163 Ron{EW} { printf("Rolo");plastc();}
164 John printf("Rastus");
165 Jim printf("Bo-Jangles");
166 pontiff |
167 pope printf("wiz'");
168 [Pp]ravda printf("dat commie rag");
169 broken printf("bugger'd");
170 strange{EW} { printf("funky");plastc();}
171 dance{EW} { printf("boogy");plastc();}
172 ask printf("ax'");
173 {BW}so{EW} { printf("%cso's",yytext[0]);plastc();}
174 heard printf("'hoid");
175 head printf("'haid");
176 boss printf("main man");
177 money printf("bre'd");
178 [a-z]":" { *(yytext+1) = ',';
179 printf("%s dig dis:",yytext);
180 }
181 amateur printf("begina'");
182 radio printf("transista'");
183 {BW}of{EW} { printf("%cuh",yytext[0]);plastc();}
184 which |
185 what printf("whut");
186 "don't" printf("doan'");
187 does printf("duz");
188 {BW}was{EW} |
189 {BW}were{EW} { printf("%cwuz",yytext[0]);plastc();}
190 {BW}understand printf("%cdig",yytext[0]);
191 {BW}my printf("%cmah'",yytext[0]);
192 again |
193 against printf("agin'");
194 {BW}[Ii]{EW} { printf("%cah'",yytext[0]);plastc();}
195 meta printf("meta-fuckin'");
196 cally printf("c'l");
197 %%
198 plastc()
199 {
200 yyunput(yytext[yyleng-1], yytext);
201 }
202
203 caseify(c)
204 char c;
205 {
206 if (yytext[0] <= 'Z')
207 return (c - ' ');
208 else
209 return (c);
210 }
211
212 thing(c)
213 char c;
214 {
215 static short count = 0;
216
217 putchar(c);
218 switch (count++ % 4) {
219 case 0: case 2:
220 printf("thang");
221 break;
222 case 1:
223 printf("doohickey");
224 break;
225 case 3:
226 printf("wahtahmellun");
227 break;
228 }
229 }
230 expletive()
231 {
232 static short count = 0;
233 static short which = 0;
234
235 if (count++ % 4 == 0) {
236 switch (which++ % 5) {
237 case 0: printf(" What it is, Mama!"); break;
238 case 1: printf(" Ya' know?"); break;
239 case 2: printf(" Sheeeiit."); break;
240 case 3: printf(" Ya' dig?"); break;
241 case 4: printf(" Git down!"); break;
242 }
243 }
244 }
245
246 main()
247 {
248 yylex();
249 }
250
251 int yywrap()
252 {
253 return 1;
254 }
255
256 /*
257 * Bugs:
258 *
259 * If a sentence starts with a keyword it doan' get converted, or:
260 * it do, but gets a leading space
261 */
This page took 0.035172 seconds and 5 git commands to generate.