AI Summary
[DOCUMENT_TYPE: user_assignment]
**What This Document Is**
This document details a programming assignment for CS 780, Compiler Design and Construction, at Wright State University. Specifically, it outlines the requirements for Assignment 2, which focuses on the crucial first step in compiler creation: lexical analysis. Students will be tasked with building a lexical analyzer – sometimes called a scanner or tokenizer – for the Cool programming language. The assignment leverages the ‘flex’ tool, a popular lexical analyzer generator, and requires students to understand and implement token specifications based on the Cool language definition.
**Why This Document Matters**
This assignment is essential for students enrolled in a compiler design course. Successfully completing it demonstrates a foundational understanding of how source code is broken down into its fundamental components, a necessary precursor to parsing, semantic analysis, and ultimately, code generation. It’s particularly valuable for students preparing for roles in software development, language design, or compiler construction. Students should review this assignment description at the start of the assignment timeframe to plan their work and understand expectations.
**Common Limitations or Challenges**
This document provides the assignment specifications and setup instructions, but it does *not* include pre-written code solutions or detailed walkthroughs of the implementation process. Students will need to independently learn and apply the concepts of lexical analysis and the specifics of the ‘flex’ tool. It also doesn’t provide extensive testing examples; students are expected to develop their own comprehensive test cases. The document assumes a basic understanding of programming concepts and a willingness to consult external resources like the ‘flex’ manual.
**What This Document Provides**
* A clear overview of the assignment’s objectives and its place within the larger compiler construction process.
* Instructions for obtaining the necessary files and setting up the development environment.
* A list of files that students will be modifying, including the ‘cool.flex’ file, a sample input file (‘test.cl’), and a ‘README’ file with further guidance.
* Guidance on managing the software environment and ensuring the correct versions of tools are used.
* A reference to the CoolAid Manual for the formal specification of the Cool language’s lexical structure.