Re: Looking for Unix lex for modern systems

gah4 <gah4@u.washington.edu>
Wed, 12 Jan 2022 14:45:57 -0800 (PST)

          From comp.compilers

Related articles
Looking for Unix lex for modern systems arnold@skeeve.com (2022-01-06)
Re: Looking for Unix lex for modern systems gah4@u.washington.edu (gah4) (2022-01-06)
Re: Looking for Unix lex for modern systems gah4@u.washington.edu (gah4) (2022-01-07)
Re: Looking for Unix lex for modern systems gah4@u.washington.edu (gah4) (2022-01-07)
Re: Looking for Unix lex for modern systems arnold@skeeve.com (2022-01-09)
Re: Looking for Unix lex for modern systems gah4@u.washington.edu (gah4) (2022-01-09)
Re: Looking for Unix lex for modern systems gah4@u.washington.edu (gah4) (2022-01-12)
| List of all articles for this month |

From: gah4 <gah4@u.washington.edu>
Newsgroups: comp.compilers
Date: Wed, 12 Jan 2022 14:45:57 -0800 (PST)
Organization: Compilers Central
References: 22-01-023 22-01-025 22-01-036 22-01-040
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="49917"; mail-complaints-to="abuse@iecc.com"
Keywords: lex, history, comment
Posted-Date: 12 Jan 2022 18:00:28 EST
In-Reply-To: 22-01-040

On Sunday, January 9, 2022 at 5:46:03 PM UTC-8, gah4 wrote:


(snip on running actual lex)


> I then ran it with the sample program in the Wikipedia lex article,
> and it ran out of buffer space. It isn't very big, either.


(snip)


> In any case, I don't understand the buffer space message.
> [AT&T lex was a student summer project and it has a bunch of fixed
> size buffers. -John]


OK, the sample in Wikipedia lex article has lines:


/* This tells flex to read only one input file */
%option noyywrap


It turns out that if you give that line to lex, it sets the size of the
output buffer to zero. (I got suspicious when the comment
mentioned flex, but had already found the output buffer
size was zero.)


Since I have the O'Reilly "Lex & Yacc" book, I could look up
lex options. It seems that


%o (number)


sets the output buffer size in lex, and zero if there is no number.


The rest of the syntax might be the same between lex and flex,
but the option syntax is not! (Hint to those working with old files.)
[It's on page 159, %e %p %n %k %a %o. That last flag is the number
of "output slots" whatever they were. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.