|why use flex? email@example.com (Frank Hale) (1999-01-27)|
|Re: why use flex? firstname.lastname@example.org (1999-01-31)|
|Re: why use flex? email@example.com (1999-01-31)|
|Re: why use flex? firstname.lastname@example.org (1999-02-01)|
|Re: why use flex? email@example.com (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? firstname.lastname@example.org (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]|
|Date:||31 Jan 1999 01:14:31 -0500|
Frank Hale email@example.com asked
> Why would someone use flex as opposed to writing there own lexer?
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
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
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.
Return to the
Search the comp.compilers archives again.