Thread: Flex vs Lex

Flex vs Lex

From
Peter Eisentraut
Date:
Barring protests, I will instruct configure and the makefiles to only look
for and use Flex rather than any old Lex, since the latter won't work
anyway. If at a later date someone has a burning desire to make things
work with FooNix Lex it should be a relatively simple change back -- in
any case simpler than making that other lex work in the first place.


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



Re: Flex vs Lex

From
The Hermit Hacker
Date:
On Sun, 20 Aug 2000, Peter Eisentraut wrote:

> Barring protests, I will instruct configure and the makefiles to only look
> for and use Flex rather than any old Lex, since the latter won't work
> anyway. If at a later date someone has a burning desire to make things
> work with FooNix Lex it should be a relatively simple change back -- in
> any case simpler than making that other lex work in the first place.

okay, just checked FreeBSD, and /usr/bin/lex == /usr/bin/flex, so we're
safe here, but what about the other OSs? Any chance one of them has flex
installed as just lex?




Re: Flex vs Lex

From
Bruce Momjian
Date:
> On Sun, 20 Aug 2000, Peter Eisentraut wrote:
> 
> > Barring protests, I will instruct configure and the makefiles to only look
> > for and use Flex rather than any old Lex, since the latter won't work
> > anyway. If at a later date someone has a burning desire to make things
> > work with FooNix Lex it should be a relatively simple change back -- in
> > any case simpler than making that other lex work in the first place.
> 
> okay, just checked FreeBSD, and /usr/bin/lex == /usr/bin/flex, so we're
> safe here, but what about the other OSs? Any chance one of them has flex
> installed as just lex?

BSDI.  Don't make the change.
#$ flexbash: flex: command not found#$ lex

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


and! Bison vs yacc Re: Flex vs Lex

From
Alfred Perlstein
Date:
* Peter Eisentraut <peter_e@gmx.net> [000820 04:06] wrote:
> Barring protests, I will instruct configure and the makefiles to only look
> for and use Flex rather than any old Lex, since the latter won't work
> anyway. If at a later date someone has a burning desire to make things
> work with FooNix Lex it should be a relatively simple change back -- in
> any case simpler than making that other lex work in the first place.

I'm not sure if it's still an issue but FreeBSD has removed bison
from the base system (I think NetBSD has as well but it was a long
time ago) the problem is that last I checked FreeBSD's yacc can't
handle one of postgresql's grammar description files and therefore
requires bison to be present.

Basically the configure script ought to abort if bison isn't found,
yacc doesn't work as a replacement.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


Re: and! Bison vs yacc Re: Flex vs Lex

From
Tom Lane
Date:
Alfred Perlstein <bright@wintelcom.net> writes:
> Basically the configure script ought to abort if bison isn't found,

Certainly not, seeing as how the standard distribution doesn't require
the recipient to run bison at all.  It's only an issue if you are
working from CVS sources.  Even then, there are vendor yaccs that will
work (possibly after some YFLAGS-tuning), and it is not configure's
charter to prevent you from using them.  I am not sure there are any
non-flex lexes that will work, though.

The nasty part of this is that some OSes seem to have flex or bison
installed only under the name 'lex' or 'yacc'.  Probably what configure
should do is 1. Search for flex; if found, use it. 2. Search for lex; if found, test to see if it's really flex    (eg,
bychecking "lex --version" output).
 
and likewise for bison (except go ahead and try to use yacc even
if it's not bison).
        regards, tom lane