* Better flex fixups; make sure to link with -lfl even if building
authorjoey <joey@a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Tue, 15 Apr 2003 22:15:55 +0000 (22:15 +0000)
committerjoey <joey@a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Tue, 15 Apr 2003 22:15:55 +0000 (22:15 +0000)
     indivitually, and move stuff that uses unput into %{ %} delimited blocks
     in rules section.

Makefile
cockney.l
debian/changelog
jethro.l
jive.l
ken.l
nyc.l

index 1244d28152ae62156ec9a893a932f47da422487d..61342fb637c4911f3d8ea5f1206778e5207fab7c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 LEX    = flex
 BUILD  = jethro kraut cockney jive nyc ken ky00te newspeak
 OTHER  = eleet b1ff chef jibberish upside-down rasterman studly fudd censor spammer
-CFLAGS = -O2
+CFLAGS = -O2 -lfl
 INSTALL_PROGRAM = install
 
 # DEB_BUILD_OPTIONS suport, to control binary stripping.
@@ -39,7 +39,7 @@ clean:
 .l:
        $(RM) $*.c
        $(LEX) -t $< > $*.c
-       $(CC) -O -o $@ $*.c -lfl $(CFLAGS)
+       $(CC) -o $@ $*.c $(CFLAGS)
        $(RM) $*.c
 
 .SUFFIXES: .dir
index 823af7e98d609d3067590a7c72799d1ce5580c04..f6d0ad202958460041f56bb34a2264b86406019f 100644 (file)
--- a/cockney.l
+++ b/cockney.l
@@ -16,6 +16,20 @@ EW [ \t.,;!\?$]
 %Start junk
 
 %%
+
+%{
+       void eos() {
+           if (yytext[yyleng-1] == '.')
+               dintI();
+           else
+               unput(yytext[yyleng-1]);
+       }
+
+       void plastc() {
+           unput(yytext[yyleng-1]);
+       }
+%}
+
 <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);
@@ -89,29 +103,6 @@ ime{EW}                     {       printf("oime"); eos(); }
 
 %%
 
-eos()
-{
-    if (yytext[yyleng-1] == '.')
-       dintI();
-    else
-       yyunput(yytext[yyleng-1], yytext);
-}
-
-plastc()
-{
-    yyunput(yytext[yyleng-1], yytext);
-}
-
-main()
-{
-        yylex();
-}
-
-int yywrap()
-{
-       return 1;
-}
-
 caseify(c)
 char c;
 {
index 8079bbce962f65d40c6061f550b4f7d987cc66a0..0809c262752a7b8d0a118e0bbb674de500de7c5e 100644 (file)
@@ -1,3 +1,11 @@
+filters (2.33) unstable; urgency=low
+
+  * Better flex fixups; make sure to link with -lfl even if building
+    indivitually, and move stuff that uses unput into %{ %} delimited blocks
+    in rules section.
+
+ -- Joey Hess <joeyh@debian.org>  Tue, 15 Apr 2003 15:06:25 -0400
+
 filters (2.32) unstable; urgency=low
 
   * Deal with the new flex 2.5.31 as follows:
index 89ed150e84ddb071e1699318958dd6cc198ff618..408d396a9adbc3427da4465e7f85a38196691f63 100644 (file)
--- a/jethro.l
+++ b/jethro.l
@@ -263,13 +263,3 @@ er{EW}                     ESUB("uh");
 !                      SUB(". Ye DAWGies!!!");
 
 %%
-
-main()
-{
-       yylex();
-}
-
-int yywrap()
-{
-       return 1;
-}
diff --git a/jive.l b/jive.l
index 750b3cdb9a5921db2c605cf0f0313a2d3383718a..1171975dae6e0b51212b0c14967318107639a102 100644 (file)
--- a/jive.l
+++ b/jive.l
 BW [ \t\(]
 EW [ \t.,;!\?$\)]
 %%
+%{
+       void plastc()
+       {
+               unput(yytext[yyleng-1]);
+       }
+%}
 @[Bb]egin(.*)          |
 ".so ".*$                      printf("%s", yytext);
 {BW}send                       printf("%ct'row",yytext[0]);
@@ -195,10 +201,6 @@ against                            printf("agin'");
 meta                           printf("meta-fuckin'");
 cally                          printf("c'l");
 %%
-plastc()
-{
-       yyunput(yytext[yyleng-1], yytext);
-}
 
 caseify(c)
 char c;
@@ -243,16 +245,6 @@ expletive()
                }
 }
 
-main()
-{
-       yylex();
-}
-
-int yywrap()
-{
-       return 1;
-}
-
 /*
  * Bugs:
  *
diff --git a/ken.l b/ken.l
index 6c6788c9a27190b8cdafa5ad3f12e62deee6ac76..a8ee14c98e18a5304a999e80e61fc82295f82ba0 100644 (file)
--- a/ken.l
+++ b/ken.l
@@ -286,14 +286,3 @@ aw         printf("or");
 .              printf(yytext);
 \n             printf("\n");
 %%
-
-main()
-{
-       srand(getpid());
-       yylex();
-}
-
-int yywrap()
-{
-       return 1;
-}
diff --git a/nyc.l b/nyc.l
index e6546b276951410176b34cfa999e708a396af680..b00f2b078288d1acaccc727f47b9c1818a271590 100644 (file)
--- a/nyc.l
+++ b/nyc.l
@@ -12,6 +12,11 @@ BW [ \t]
 SP [ \t]
 EW [ \t.,;!\?$]
 %%
+%{
+       void plastc() {
+               yyunput(yytext[yyleng-1], yytext);
+       }
+%}
 ".so ".*$                      printf("%s", yytext);
 [ao]ther                       printf("%cdder", yytext[0]=='a'?'a':'u');
 [Nn]othing                     printf("%cuttin'", yytext[0]);
@@ -66,10 +71,6 @@ negro                                printf("spade");
 !                              printf("!  Okay?");
 [a-z]"."               {       printf("%s", yytext);expletive();}
 %%
-plastc()
-{
-       yyunput(yytext[yyleng-1], yytext);
-}
 
 caseify(c)
 char c;
This page took 0.017072 seconds and 4 git commands to generate.