[comp.lang.c] yywrap

rsalz@bbn.com (Rich Salz) (04/17/89)

In <LFK.89Apr16010905@mbio.med.upenn.edu> lfk@mbio.med.upenn.edu (Lee Kolakowski) writes:
>Does anyone know what yywrap does so that I can write a look-a-like?
As it says in the supplementary documentation (variously called Volume2,
PRM, Programmer's Language Guide, etc.), yywrap() is called by Lex
when input() says it's found EOF (which it does by returning 0!).  yywrap
is supposed to return 0 if there is more input, 1 if there isn't.

The default yywrap is
	yywrap() { return 1; }
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.

egisin@mks.UUCP (Eric Gisin) (04/17/89)

In article <LFK.89Apr16010905@mbio.med.upenn.edu>, lfk@mbio.med.upenn.edu (Lee Kolakowski) writes:
> Does anyone know what yywrap does so that I can write a look-a-like?

I had to write yywrap for MKS lex.
It tooks several weeks of studying the manuals, banging
my head against the wall, 36 hour days, and Kilos of caffine.
I wouldn't want anyone to go through that Hell so I am
offering the MKS version for general use. Here it is.

/*
 * Copyright 1988 Mortice Kern Systems Inc.
 * All rights reserved.
 */

/*
 * default yywrap that tells yylex to return 0
 */

int
yywrap()
{
	return 1;
}

bright@Data-IO.COM (Walter Bright) (04/18/89)

In article <777@mks.UUCP> egisin@mks.UUCP (Eric Gisin) writes:
</* Copyright 1988 Mortice Kern Systems Inc.
< * All rights reserved.
< */
<int yywrap() {	return 1; }

ARGGH! I suppose I can't write any more functions that return 1, MKS
has a lock on it now. Maybe I'll copyright all functions that return 2!

:-) :-) :-)

gwyn@smoke.BRL.MIL (Doug Gwyn) (04/18/89)

In article <1946@dataio.Data-IO.COM> bright@dataio.Data-IO.COM (Walter Bright) writes:
>In article <777@mks.UUCP> egisin@mks.UUCP (Eric Gisin) writes:
></* Copyright 1988 Mortice Kern Systems Inc.
>< * All rights reserved.
>< */
><int yywrap() {	return 1; }
>ARGGH! I suppose I can't write any more functions that return 1, MKS
>has a lock on it now. Maybe I'll copyright all functions that return 2!

You should see AT&T's copyright on /bin/true -- they've copyrighted an
empty string!!!  We're all in violation!

Also note that there are fewer than 2^(16^16) mouse icon patterns for
Blit-like terminals.  Copyright them all and you could squeeze a lot of
terminal vendors for royalties.  This is not an entirely frivolous
example -- there's a company that claims royalties for the use of XOR
to reversibly overlay images on bitmap displays, and some Australian
companies are notorious for filing for international trademark rights
to any commercial name that seems to be about to take off.

denbeste@bgsuvax.UUCP (William C. DenBesten) (04/19/89)

In article <777@mks.UUCP> egisin@mks.UUCP (Eric Gisin) writes:
</* Copyright 1988 Mortice Kern Systems Inc.
< * All rights reserved.
< */
<int yywrap() {	return 1; }


I did it an even easier way.

     #define yywrap() 1

mcdonald@uxe.cso.uiuc.edu (04/22/89)

>Too late!  I hereby copyright the following bit patterns:

>    0 0   1 0   0 1   0 0   0 0   1 1   1 0   1 0   0 1   0 1   0 0
>    0 0   0 0   0 0   0 1   1 0   0 0   0 1   1 0   0 1   1 0   1 1

>    (C) Copyright 1989 Rahul Dhesi, All Rights Reserved

>    It is a violation of my copyright for anybody to create any
>    derivative work.  You may not incorporate these patterns into your
>    icons without my permission.

The following bit pattern

    1 1
    1 1

     (C) Copyright 1989 J. Douglas McDonald. All rights reserved.
 No one may use this bit pattern or any derivative thereof without
permission.

************
Dear Rahul: You copyrighted the Darkness, I shall take the Light.

************
And leave the lighter shades of gray to others.

Doug McDonald

(Actually, this should not be in comp.lang.c - but it IS fun)

mjg@rtmvax.UUCP (Mike Gogulski) (04/25/89)

In article <225800161@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes:
>
>The following bit pattern
>
>    1 1
>    1 1
>
>     (C) Copyright 1989 J. Douglas McDonald. All rights reserved.
> No one may use this bit pattern or any derivative thereof without
>permission.
>

And here is my entry:

	1

   Copyright (C) 1989 Michael J. Gogulski. The author reserves all
rights regarding the use, distribution, and sale of this bit pattern.
This bit pattern may not appear in any work without the inclusion of
this copyright notice.


+-----------------------------------------------------------------------------+
| Mike Gogulski		| "Come on and do the Toxic Waltz		      |
| mjg@rtmvax.UUCP	|  And slam your partner against the wall..."	      |
| mjg@ucfunix.UUCP	|		-- Exodus, "The Toxic Waltz"	      |
+-----------------------------------------------------------------------------+

gwyn@smoke.BRL.MIL (Doug Gwyn) (04/26/89)

In article <2985@rtmvax.UUCP> mjg@rtmvax.UUCP (Mike Gogulski) writes:
>	1
>   Copyright (C) 1989 Michael J. Gogulski. ...

All you guys are infringing on AT&T's prior copyright of the empty string.

kers@otter.hpl.hp.com (Chris Dollin) (04/26/89)

Well, since this is getting silly anyway, here's *my* entry in the copyrighted
bitsequence contest:

    Arb = (0 | 1)*              (One dimension)
    Any = Arb (; Arb)*          (Two dimensions)

where ";" is the next-row delimiter. These bit-patterns are copyrighted, ....

Regards,                    | "Copy right? What computer can manage that?"
Kers.