File: jethro.l

package info (click to toggle)
filters 2.22
  • links: PTS
  • area: main
  • in suites: woody
  • size: 252 kB
  • ctags: 145
  • sloc: lex: 1,868; perl: 269; makefile: 81; sh: 6
file content (273 lines) | stat: -rw-r--r-- 7,112 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273

 /* jethro.l */
%e 7000
%k 5000
%p 9000
%n 2000
%a 9000
%o 7000

SW	[\n \"(]
EW	[\n ".",\"!?):;]
BW	[\n ]

%{
 /* 
 **   jethro  v. 1.00 06/10/93
 **   Duane Paulson <ci922@cleveland.freenet.edu> "dap"
 **   Hillbilly text filter. Compile with lex, then C.
 **   syntax will be:
 **	  jethro <input_file >output_file.
 **   Public domain. Use at your own risk. Y'all come back now, heah?
 */
 /*************************************************************************
				REVISION LOG
 when      ver   who  change
 --------  ----  ---  -----------------------------------------------------
 06/10/93  1.00  dap  Initial release.
 8.May.94  1.10  beg  Fixed for HP-UX
 *************************************************************************/

#define PUTLAST unput(*(yytext+strlen(yytext)-1));
#define SUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1);
#define SSUB(A) fprintf(yyout, "%c%c%s", *yytext, *A|(*(yytext+1)&32), A+1);
#define SESUB(A) fprintf(yyout, "%c%c%s", *yytext, *A|(*(yytext+1)&32), A+1); PUTLAST;
#define ESUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1); PUTLAST;

#include <string.h>

char WhAt[]="@(#)Duane Paulson's hillbilly text filter. (jethro)\n@(#)$Header: jethro.l,v 1.1 94/05/08 23:41:58 bgriffin Final $"
;

%}

%%

{SW}[Gg]reetings{EW}	|
{SW}[Hh]i{EW}		|
{SW}[Hh]ello{EW}	SESUB("Howdy");
{SW}[Bb]ye{EW}		|
{SW}[Gg]oodbye{EW}	SESUB("Y'all come back now, heah?");
{SW}[Hh]ear{EW}	SESUB("Heah");
{SW}[Cc]ar{EW}		|
{SW}[Aa]uto{EW}		|
{SW}[Rr]elax{EW}	SESUB("Set a spell -- put yore feet up");
{SW}[Aa]utomobile{EW}	SESUB("Gasoline buggy");
[Ss]wimming{BW}pool	SUB("Cement pond");
[Pp]ool{BW}table	SUB("Fancy eatin table");
[Pp]ool{BW}cue		|
[Cc]ue{BW}stick		SUB("Fancy pot passer");
{SW}[Bb][r]?oil{EW}	|
{SW}[Bb]ake{EW}		|
{SW}[Ff]ry{EW}		|
{SW}[Ss]aute{EW}	|
{SW}[Cc]ook{EW}	SESUB("Whomp up");
{SW}[Bb][r]?oiling{EW}	|
{SW}[Bb]akeing{EW}	|
{SW}[Ff]rying{EW}	|
{SW}[Ss]auteing{EW}	|
{SW}[Cc]ooking{EW}	SESUB("Whompin up");
{SW}[Bb][r]?oiled{EW}	|
{SW}[Bb]aked{EW}	|
{SW}[Ff]ryed{EW}	|
{SW}[Ss]auted{EW}	|
{SW}[Cc]ooked{EW}	SESUB("Done whomped up");
{SW}[Bb][r]?oils{EW}	|
{SW}[Bb]akes{EW}	|
{SW}[Ff]rys{EW}		|
{SW}[Ss]autes{EW}	|
{SW}[Cc]ooks{EW}	SESUB("Whomps up");
{SW}[Gg]roceries{EW}	|
{SW}[Ff]ood{EW}		SESUB("Vittles");
[Ss]alad		SUB("Slaw");
[Vv]egetable		SUB("Green");
[Pp]otato		SUB("Tater");
{SW}[Tt]omato		SSUB("Tuhmater");
{SW}[Rr]hubarb{EW}	SESUB("Pie plant");
{SW}[Ll]iquor{EW}	|
{SW}[Ww]hisk[e]?y{EW}	|
{SW}[Ss]cotch{EW}	|
{SW}[Bb]ourbon{EW}	|
{SW}[Gg]in{EW}		|
{SW}[Vv]odka{EW}	|
{SW}[Tt]equila{EW}	|
{SW}[Ll]iqueur{EW}	SESUB("Rheumatiz medcin");
{SW}[Bb]ooze{EW}	SESUB("Corn likker");
{SW}[Cc]ocktail{EW}	|
{SW}[Mm]ixed{BW}drink{EW} SESUB("Waste of good likker");
{SW}[Bb]ar{EW}		SESUB("Dance hall");
{SW}[Bb]ars{EW}		SESUB("Dance halls");
{SW}[Ss]aloon		|
{SW}[Cc]ocktail{BW}lounge SESUB("Dance hall");
{SW}[Ww]hore		|
{SW}[Pp]rostitute	|
{SW}[Ss]lut		SSUB("Dance hall girl");
{SW}[Ss]ecret{BW}agent{EW} |
{SW}[Ss]py{EW}		|
{SW}007{EW}		SESUB("Double nought spy");
{SW}[Zz]ero{EW}		SESUB("Nought");
{SW}[Pp]ants{EW}	SESUB("Trousers");
{SW}[Jj]eans{EW}	|
{SW}[Dd]ungarees{EW}	|
{SW}[Ll]evi[']?s{EW}	SESUB("Overhalls");
{SW}[Ss]hoe		SSUB("High-button shoe");
{SW}[Jj]acket		SSUB("Coat");
{SW}[Ss]hotgun		SSUB("Fowlin piece");
{SW}[Rr]evolver		|
{SW}[Gg]un		SSUB("Shootin iron");
{SW}[Rr]ifle		SSUB("Ozark longrifle");
{SW}[Ll]ibrar[yi]	SSUB("Liberry");
[Ww]ash			SUB("Warsh");
[Ff]amily		SUB("Fambly");
[Ff]ry{BW}pan		|
[Ff]rying{BW}pan	|
[Ss]aute{BW}pan		SUB("Skillet");
{SW}[Aa]nimal		SSUB("Critter");
{SW}FBI{EW}		|
{SW}F.B.I.{EW}		|
{SW}CIA{EW}		|
{SW}C.I.A.{EW}		|
{SW}ATF{EW}		|
{SW}A.T.F.{EW}		|
{SW}IRS{EW}		|
{SW}I.R.S.{EW}		|
{SW}SS{EW}		|
{SW}S.S.{EW}		|
{SW}[Ss]elective{BW}[Ss]ervice{EW} |
{SW}[Ss]elective{BW}[Ss]ervice{BW}[Ss]ystem{EW} |
{SW}[Ss]ecret{BW}[Ss]ervice{EW} SESUB("Revanooers");
{SW}[Pp]olice		|
{SW}[Pp]oliceman	|
{SW}[Ss]heriff		|
{SW}[Dd]eputy		|
{SW}[Dd]eputy{BW}[Ss]heriff |
{SW}[Mm]arshall		|
{SW}[Dd]eputy{BW}[Mm]arshall |
{SW}[Pp]ark{BW}[Rr]anger |
{SW}[Tt]exas{BW}[Rr]anger |
{SW}[Hh]ighway{BW}[Pp]atrol SSUB("Constable");

{SW}[Mm]other		|
{SW}[Mm][ao]mm[ay]? 	|
{SW}[Mm]ommie		|
{SW}[Mm]om		SSUB("Maw");
{SW}[Mm]a{EW}		SESUB("Maw");
{SW}[Ff]ather		SSUB("Paw");
{SW}[Dd]ad{EW}		|
{SW}[Dd]addy		|
{SW}[Pp]a{EW}		|
{SW}[Pp][ao]p{EW}	|
{SW}[Pp][ao]pp[ay]?{EW} SESUB("Paw");
{SW}[Gg]randmother{EW}	|
{SW}[Gg]randma[w]?{EW}	SESUB("Granny");
{SW}[Gg]randfather{EW}	|
{SW}[Gg]ran[d]{1,2}ad[d]?[y]?{EW} |
{SW}[Gg]randpop{EW}	|
{SW}[Gg]randpa[w]?{EW}	SESUB("Grampy");
{SW}[Mm]y{EW}		SESUB("Mah");
{SW}them{EW}		SESUB("em");
[Dd]og			SUB("Dawg");
[Ll]awyer		|
[Ll]egal{BW}counc[ei]l	|
[Ll]egal{BW}councellor	|
[Aa]ttorney		|
[Aa]ttorney{BW}[Aa]t{BW}[Ll]aw SUB("City slicker");

{SW}[Tt]han{EW}		SESUB("Then");
[Cc]haracterize		SUB("Show");
{SW}[Vv]ery{EW}		|
{SW}[Ee]xtremely{EW}	|
{SW}[Rr]eally{EW}	|
{SW}[Rr]eal{EW}		SESUB("Right");
{SW}[Hh]aven't{EW}	|
{SW}[Ii]sn't{EW}	|
{SW}[Aa]ren't{EW}	SESUB("Aint");
{SW}[Ss]aid{EW}		|
{SW}[Ss]ays{EW}		SESUB("Sez");		
{SW}[Aa]re{EW}		SESUB("Is");
{SW}[Ss]hould{EW}	SESUB("Ortta");
{SW}[Pp]erhaps{EW}	|
{SW}[Mm]aybe{EW}	SESUB("Mebbe");
{SW}[Ss]ick{EW}		SESUB("Ailin'");
{SW}I'm{BW}not{EW}	SESUB("I aint");
{SW}[Ss]cared{EW}	SESUB("A-skeert");
{SW}[Ss]care		SSUB("Skeer");
{SW}[Hh]ave{EW}		SESUB("Got");
{SW}[Pp]ossess{EW}	SESUB("Have");
{SW}[Hh]elp		SSUB("Hep");
{SW}[Tt]ired{EW}	SESUB("Tuckered out");
{SW}[Cc]ompletely{EW}	SESUB("Plumb");
{SW}[Dd]runk{EW}	SESUB("A mite woozy");

{SW}[Yy]es{EW}		SESUB("Yep");
{SW}[Nn]o{EW}		SESUB("Nope");

{SW}[Ii]t{BW}is{EW}	SESUB("Tis");
{SW}[Aa]t{BW}all{EW}	*(yytext+1)=(char)'A'; SESUB("A tall");

{SW}[Aa]m{EW}		|
{SW}[Aa]re{EW}		SESUB("Is");
{SW}[Ww]as{EW}		|
{SW}[Ww]ere{EW}		SESUB("Wuz");
{SW}[Ww]asn't{EW}	SESUB("Wasunt");
[Ee]very		SUB("Ever");
{SW}[Ww]ant/s		SSUB("Is after");
{SW}[Ww]anted{EW}	SESUB("Was after");
{SW}[Ww]anting{EW}	SESUB("Hankering after");
{SW}[Dd]oesn't{EW}	|
{SW}[Dd]on't{EW}	SESUB("Dasent");
{SW}[Yy]ou'll{EW}	SESUB("Y'all will");
{SW}[Yy]our		SSUB("Yore");
{SW}[Mm]ore{EW}		SESUB("Mo");
tial			SUB("shul");
cious			SUB("shus");
ious			SUB("yus");
tion			SUB("shun");
{SW}[Cc]an{EW}		SESUB("C'n");
{SW}[Yy]ou{EW}		SESUB("Y'all");
{SW}[Ff]or{EW}		SESUB("Fer");
{SW}[Tt]he{EW}		SESUB("Duh");
ing			SUB("in");
{SW}[Tt]oo{EW}		SESUB("Besides");
{SW}[Tt]o{EW}		SESUB("Tuh");
{SW}[Aa][n]?{EW}	SESUB("Ah");
{SW}[Aa]re{EW}		|
{SW}[Oo]ur{EW}		|
{SW}[Oo]r{EW}		SESUB("Ore");
{SW}[Oo]f{EW}		SESUB("Uv");
{SW}I{EW}		SESUB("Ah");
{SW}I'm{EW}		SESUB("Ahm a");
{SW}I'll{EW}		SESUB("Ahl");
{SW}I'd{EW}		SESUB("Ah wood");
'nt			*(yytext)=(char)'u'; SUB("unt");
're			SUB(" is");
've			SUB(" done");
eed{EW}			ECHO;
ed{EW}			ESUB("d");
{SW}[Oo]wn{EW}		|
{SW}[Tt]own{EW}		|
{SW}[Dd]own{EW}		|
{SW}[Gg]own{EW}		|
{SW}[Bb]rown{EW}	ECHO;
wn{EW}			ESUB("ed");
{SW}[Bb]elow{EW}	|
{SW}[Kk]now{EW}		|
{SW}[Tt]hrow{EW}	|
{SW}[Gg]row{EW}		|
{SW}[Hh]ow{EW}		|
{SW}[Nn]ow{EW}		|
{SW}[Bb]row{EW}		|
{SW}[Ss]how{EW}		ECHO;
ow{EW}			ESUB("er");
re{EW}			|
er{EW}			ESUB("uh");
{SW}[Hh]er{EW}		ECHO;
!			SUB(". Ye DAWGies!!!");

%%

main()
{
	yylex();
}