Lex.

From: R. Clayton <rvclayton_at_acm.org>
Date: Mon, 22 Jan 2007 15:40:59 -0500

  Can we use the Lex Analyzer in unix to assist us with assignment1?

I don't recommend you use lex (or its knock-offs like flex) for at least three
reasons. First, if I'm remembering correctly, nobody in class is familiar with
regular expressions; if you don't know how to use regular expressions, then you
don't know how to use lex.

Second, C++ stream extraction is all you need to break up input into tokens; no
need to resort to something more complicated like lex. It will be much more
useful to you, in terms of getting your assignments done, to spend your time
learning how to exploit c++ stream io than it will be spending your time
learning lex.

Third, lex-generated code misbehaves in mysterious ways when it encounters
erroneous input. Getting it to not misbehave and fixing it when it does are
non-trivial tasks.

This is not to say you shouldn't learn lex; it's a useful tool and I recommend
you learn it eventually. But, I'm guessing you have a limited time budget for
the assignments and the time you spend learning lex will, most likely, not be
repaid by allowing you to get your assignments done more quickly.
Received on Mon Jan 22 2007 - 15:41:53 EST

This archive was generated by hypermail 2.2.0 : Tue Jan 23 2007 - 23:47:02 EST