Lexical analyzers can be written by hand or generated
automatically using programs such as LEX, in both cases based on the specification
of tokens with regular expressions. Generated lexical analyzers create
large tables and are typically less efficient than hand written ones; hand
written ones are fairly easy to program, so this is usually the chosen
method. However, you are free to use a lexical analyzer generator for this
portion of the project. Whichever method you choose, you will likely spend
about the same amount of time and effort.