Subject: Re: flex ain't lex
To: Rick Kelly <rmk@rmkhome.rmkhome.com>
From: Gorgonio Araujo <gorgonio@ufba.br>
List: current-users
Date: 07/02/1996 10:17:01
On Mon, 1 Jul 1996, Rick Kelly wrote:

>
> I grabbed the "one true awk" source:
>
> http://inferno.bell-labs.com/who/bwk/awk.sh
>
> Compiles fine on SunOS 4.1.4, however, flex under NetBSD emits a
> lex.yy.c that is a bunch of functions with undeclared variables.
> On SunOS, lex emitted #define macros for the same stuff.
>
> If anyone wants my lexyy.c and hacked makefile, I would be glad to
> email it.  It's less than 50k total.
>
> It takes the "one true lex" to build the "one true awk".

Rick,

Try to use flex with ``-l'' option, from flex(1):

       -l     turns  on  maximum  compatibility with the original
              AT&T lex implementation.  Note that this  does  not
              mean  full compatibility.  Use of this option costs
              a considerable amount of performance, and it cannot
              be  used  with the -+, -f, -F, -Cf, or -CF options.
              For details on the compatibilities it provides, see
              the  section "Incompatibilities With Lex And POSIX"
              below.   This  option  also  results  in  the  name
              YY_FLEX_LEX_COMPAT being #define'd in the generated
              scanner.


[]

--
Gorgonio Araújo <gorgonio@ufba.br>
RNP - http://www.rnp.br
tel: +55 71 245-7345 - fax: +55 71 245-9163
--