Re: why use flex?

rkrayhawk@aol.com (RKRayhawk)
31 Jan 1999 01:14:31 -0500

          From comp.compilers

Related articles
why use flex? frankhale@worldnet.att.net (Frank Hale) (1999-01-27)
Re: why use flex? irclark@latveria.castledoom.org (1999-01-31)
Re: why use flex? rkrayhawk@aol.com (1999-01-31)
Re: why use flex? tnaran@direct.ca (1999-02-01)
Re: why use flex? colas@aye.inria.fr (1999-02-03)
Re: why use flex? Marko.Makela@HUT.FI (Marko =?ISO-8859-1?Q?M=E4kel=E4?=) (1999-02-03)
Re: why use flex? tnaran@direct.ca (1999-02-05)
Re: why use flex? Theodore.Papadopoulo@sophia.inria.fr (Theodore.Papadopoulo) (1999-02-05)
Re: why use flex? Marko.Makela@HUT.FI (Marko =?ISO-8859-1?Q?M=E4kel=E4?=) (1999-02-10)
[2 later articles]
| List of all articles for this month |
From: rkrayhawk@aol.com (RKRayhawk)
Newsgroups: comp.compilers
Date: 31 Jan 1999 01:14:31 -0500
Organization: AOL http://www.aol.com
References: 99-01-111
Keywords: flex

Frank Hale frankhale@worldnet.att.net asked
> Why would someone use flex as opposed to writing there own lexer?


Possible considerations;


  1) flex has been debugged, any new program starts from scratch,
coding your own may be easy at first but the testing and debuging of
the lexer can get to be a serious drain on your time. After all it is
really your syntax and grammar that you want to invest your brain
power in.


  2) there is a chance that if you express your rules in flex, some
other humans may be able to recognize what you intend, and you can get
help and maybe even find someone to pass the code onto without much
trouble,


  3) flex (and its lex kin) have well defined, simple and reliable
interfaces to debugged parsers (bison, yacc etc).


  4) every situation is unique, but when you get off on your own
tangent you tend to do unfortunate things to the idea of regular
expression scans for lexical elements, flex is fairly disciplined and
use of it keeps you standard in the syntax that you might evolve in
your iterative perfection of your envisioned tool. In other words, you
are less likely to invent a surprising lexical nuance if you use an
industry standard tool to scan your source.


Best Wishes


Robert Rayhawk
RKRayhawk@aol.com


Post a followup to this message

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