Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2825

Re: Looking for Unix lex for modern systems

From gah4 <gah4@u.washington.edu>
Newsgroups comp.compilers
Subject Re: Looking for Unix lex for modern systems
Date 2022-01-12 14:45 -0800
Organization Compilers Central
Message-ID <22-01-049@comp.compilers> (permalink)
References <22-01-023@comp.compilers> <22-01-025@comp.compilers> <22-01-036@comp.compilers> <22-01-040@comp.compilers>

Show all headers | View raw


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]

Back to comp.compilers | Previous | NextPrevious in thread | Find similar


Thread

Looking for Unix lex for modern systems arnold@skeeve.com (Aharon Robbins) - 2022-01-06 20:17 +0000
  Re: Looking for Unix lex for modern systems gah4 <gah4@u.washington.edu> - 2022-01-06 16:42 -0800
    Re: Looking for Unix lex for modern systems gah4 <gah4@u.washington.edu> - 2022-01-07 15:36 -0800
  Re: Looking for Unix lex for modern systems gah4 <gah4@u.washington.edu> - 2022-01-07 02:39 -0800
    Re: Looking for Unix lex for modern systems arnold@skeeve.com (Aharon Robbins) - 2022-01-09 19:04 +0000
      Re: Looking for Unix lex for modern systems gah4 <gah4@u.washington.edu> - 2022-01-09 17:03 -0800
        Re: Looking for Unix lex for modern systems gah4 <gah4@u.washington.edu> - 2022-01-12 14:45 -0800

csiph-web