CS331 Compilers Project
Phase 1

LEXICAL ANALYZER

The lexical analyzer will be designed to isolate tokens from an input source file containing a program written in the language specified in appendix A in Compilers: Principles, Techniques, and Tools. The lexical analyzer will be set up to be accessed by the parser, which will be written later in the semester.

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.

Optional stuff