From: Vern Paxson (vern@daffy.ee.lbl.gov)
Date: 06/02/92


From: vern@daffy.ee.lbl.gov (Vern Paxson)
Subject: Re: flex bug?
Date: 2 Jun 1992 16:34:09 GMT

In article <ben.707324462@joplin.wri.com> ben@joplin.wri.com (Ben Cox) writes:
>
> According to the lex manual (in the BSD4.3 manuals), input() should
> just get the next character off the input stream and return it,
> without putting it into yytext or anything.

Yes, this is basically a bug (though it's possible to read POSIX as
allowing it). Fixing it is on the to-do list for release 2.4, which
still has no scheduled release date. The problem is that input()
restores the character that was overwritten by the '\0' that terminates
yytext; why it works on the Sequent is a mystery to me.

> /* Note: I used \"[^"]* instead of \"[^\"]* because the BSD4.3 manual
> (yes, I know that's for lex and not flex) says " is not special inside
> [], although my nutshell book says to use `\"[^\"]*': this part works,
> so nutshell must be wrong... :-) */

The only magic characters inside of []'s are: '\', ']', and newline,
so '"' does not need to be escaped (though it doesn't hurt to do so).

                Vern

        Vern Paxson vern@ee.lbl.gov
        Computer Systems Engineering ucbvax!ee.lbl.gov!vern
        Lawrence Berkeley Laboratory (510) 486-7504