%option noyywrap
-%%
-
%{
-void eos();
-void plastc();
+#include<time.h>
+void eos(void);
+void plastc(void);
+char caseify(char);
+void I(void);
+void bloody(void);
+void set_did(short);
+void clear_did(void);
+void dintI(void);
+void pooped(void);
+void expletive(void);
%}
+%%
+
<junk>. { 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);
unput(yytext[yyleng-1]);
}
-caseify(c)
+char caseify(c)
char c;
{
if (yytext[0] <= 'Z')
}
-I()
+void I()
{
/* extern long random(); */
static short b_count = 0;
static short b_which = 0;
-bloody()
+void bloody()
{
if (b_count++ % 2 == 0) {
switch (b_which++ % 4) {
static short did = 0;
-set_did(val)
+void set_did(val)
+short val;
{
did = val;
}
-clear_did()
+void clear_did()
{
did = 0;
}
-dintI()
+void dintI()
{
/* extern long random(); */
clear_did();
}
-pooped()
+void pooped()
{
/* extern long random(); */
}
}
-expletive()
+void expletive()
{
/*
Blimey
BW [ \t\(]
EW [ \t.,;!\?$\)]
%option noyywrap
-%%
%{
- void plastc();
+ void plastc(void);
+ char caseify(char);
+ void expletive(void);
+ void thing(char);
%}
+%%
+
@[Bb]egin(.*) |
".so ".*$ printf("%s", yytext);
{BW}send printf("%ct'row",yytext[0]);
unput(yytext[yyleng-1]);
}
-caseify(c)
+char caseify(c)
char c;
{
if (yytext[0] <= 'Z')
return (c);
}
-thing(c)
+void thing(c)
char c;
{
static short count = 0;
break;
}
}
-expletive()
+
+void expletive()
{
static short count = 0;
static short which = 0;
#define WCOMP(string1,string2) compstring(Y0,(string1),(string2),1)
#define DUMP() printf("%s",yytext)
+
+void capstring(char, char*, int);
+void compstring(char, char*, char*, int);
+char _caseify(char, int);
+char caseify(char);
+
%}
%e 8000
%}
%%
-main()
+int main()
{
yylex();
printf("\nHail Big Brother!\n");
}
-capstring(firstchar,string,i)
+void capstring(firstchar,string,i)
char firstchar, *string;
int i;
{
printf("%s",string+1);
}
-compstring(firstchar,string1,string2,i)
+void compstring(firstchar,string1,string2,i)
char firstchar, *string1, *string2;
int i;
{
capstring(0,string2,i);
}
-_caseify(c,i)
+char _caseify(c,i)
char c;
int i;
{
else return (c);
}
-caseify(c)
+char caseify(c)
char c;
{
return _caseify(c,0);
SP [ \t]
EW [ \t.,;!\?$]
-%%
%{
- void plastc();
+ void plastc(void);
+ char caseify(char);
+ void expletive(void);
%}
+
+%%
".so ".*$ printf("%s", yytext);
[ao]ther printf("%cdder", yytext[0]=='a'?'a':'u');
[Nn]othing printf("%cuttin'", yytext[0]);
yyunput(yytext[yyleng-1], yytext);
}
-caseify(c)
+char caseify(c)
char c;
{
if (yytext[0] <= 'Z')
short count = 0;
short which = 0;
-expletive()
+void expletive()
{
if (count++ % 4 == 0) {
switch (which++ % 5) {