All assignment submissions must be your own independent and original work. Students may not read or copy another student's solutions or share their own solutions with other students. Students may not review solutions from students who have taken the course in previous years. Submissions that are substantively similar will be considered cheating by all students involved, and as such, students must be mindful not to post their code publicly. Any use of electronics or other resources during an examination will be considered cheating. If you have any doubts about whether a particular action may be construed as cheating, ask the instructor for clarification before you do it. The instructor will make the final determination of what is considered cheating.
Students choosing to work with a partner are effectively considered as one entity.
Cheating in this course will result in a grade of F for the course and may be subject to further disciplinary action.
Be aware that you may be asked to explain your code to a member of our course staff using only what you have submitted: your comments in the code should be such that you can determine what your code does and why a few weeks later, if needed.
The goal of this project is to acquire practical experience in the implementation of programming languages through the construction of a fully functional compiler for a simple procedural language. In this project, you will implement a compiler for a programming language called Cminus (or C-, for short). A detailed specification of the C- language can be found here.
The compiler project consists of 4 programming assignments: (1) lexical analysis, (2) syntactic analysis, (3) semantic analysis, and (4) code generation for the MIPS assembly language. You will be implementing your compiler in C/C++, which is the system language used in most compiler implementations. You compiler may be written using automated tools such as Flex and Bison or by hand using a recursive-descent parsing strategy. As a starting point, you can refer to the code examples and some resource pointers on the Resources section of the course page.
We will be using Gradescope for the project submission.