|[21 earlier articles]|
|Re: is lex useful? email@example.com.OZ.AU (1996-06-30)|
|Re: is lex useful? WStreett@shell.monmouth.com (1996-06-30)|
|Re: is lex useful? firstname.lastname@example.org (1996-06-30)|
|Re: is lex useful? email@example.com (1996-07-01)|
|Re: is lex useful? firstname.lastname@example.org.OZ.AU (1996-07-02)|
|Re: is lex useful? email@example.com (1996-07-02)|
|Re: is lex useful? firstname.lastname@example.org (1996-07-04)|
|Re: is lex useful? email@example.com.OZ.AU (1996-07-05)|
|From:||firstname.lastname@example.org (Colas Nahaboo)|
|Date:||4 Jul 1996 15:33:50 -0400|
|Organization:||Koala Project, Bull Research France|
Stephen Lindholm <72510.2757@CompuServe.COM> writes:
|> Along with the additional readability, I don't see why anyone
|> wouldn't use flex, aside from really bizzare syntax requirements
|> in a particular application.
Well, I have a counter-example: when your parser input can be changed on
I have a OO-lisp-like interpreter that can read transparently on file or
string objects, and you can seek the current cursor position at any time on
these objects, too.
I was using lex, but I had to support 8-bit character, so I thought it was
a good motivation to switch to flex. Well, it was a nigthmare, and the
resulting parser is much slower (10 times...!!!) than the lex one.
Because flex tries to optimize too much its input, and you have no control
on it. So when you seek to a different place in the file, you have to break
all flex optimisations, and do a lot of dirty work. Same goes with providing
parsing either on files or strings. And I don't tell you about modifying the
string while parsing it :-), all things legal and useful in dynamic script
languages. Unfortunately I had to complete the job quickly so I continues
with flex, but as soon as I have time, I will try the re2c solution.
flex is great to write a parser to parse "fixed" files, however.
Colas Nahaboo, Koala/Dyade/Bull @ INRIA Sophia, http://www.inria.fr/koala/colas
[I don't understand your problem. Flex has a bunch of documented internal
routines that let you take input from anywhere you want. If it ended up
being slower than lex, you must have been doing something really odd. -John]
Return to the
Search the comp.compilers archives again.