Course Information
CS536-S24 Intro to PLs and Compilers

On this page: Topics | Evaluation | Exams | Assignments


How credit hours are met: This is a 3-credit course on compiler design. There are 150 minutes of lecture each week, with the expectation that students will have about 6 hours of out-of-class work per week (averaged over the semester).

Topics

Scanners: Defining DFAs and NFAs, epsilon transitions, converting DFAs to NFAs, regular expressions, converting regular expressions to NFA, and using JLex.

Grammars and parsing: Limitations of regular expressions and context-free grammars, Chomsky hierarchy, grammar productions, derivation rules and ambiguity, abstract syntax tree (AST), syntax directed translation (SDT), parser generators, using JCup, bottom-up parsing vs top-down parsing, Chomsky Normal Form and CYK algorithm, grammar classes, LL(1), LALR(1), refactoring grammars, building parsing tables, FIRST and FOLLOW sets

Name and Type Analysis: Name analysis and type analysis, scopes, nested scopes, symbol tables, static vs dynamic scopes, variable shadowing, forward references, type systems, type coercion, duck typing, strong vs weak typing, dependent types.

Runtime Environments: Memory abstractions, stack layout, activation records, dynamic memory allocation and heap, frame and stack pointers, function calls, parameter passing styles: by-value, by-reference, by-name, by-value-result, accessing local and global variables, dynamic vs static scope, access links and displays, deep vs shallow access.

Code generation and optimization: Machine code generation from AST, intermediate representation (IR), three address code (3AC), backend for MIPS, code generation for functions and calls, control flow, peephole optimizations, loop invariant code motion, loop unrolling, loop fusion, intraprocedural analysis.

Evaluation

There will be a large semester-long programming project (broken down into 6 separate assignments) involving writing a compiler for a very simple language. The compiler will be written in Java, using a variety of tools, including Make, JLex, JavaCUP, and Spim. All students will work alone on the first programming assignment. Computer Sciences and Computer Engineering graduate students will work alone on the remaining assignments; undergraduates, special students, and graduate students from other departments have the option of working in pairs.

Your performance in the course will be evaluated based on the following:

Academic misconduct of any kind will not be tolerated.

Scores and feedback for individual assignments will be reported through Gradescope

Exams

There will be two midterm exams and one final exam totalling 60% of your grade. Midterm exam 1 is worth 18% of your grade, midterm exam 2 is worth 16% of your grade, and the final exam is worth 26% of your grade.

All exams will be held in-person. More information about the exams, including dates, topics, and sample problems, can be found on the Exam Info page.

Assignments

There will be six programming assignments worth a total of 40% of your final grade. Accounts are provided on the CS lab computers for you to do your programming work. See the CS Computer Labs page for more information.

Collaboration is allowed in pairs if you choose, for students who are not CS or ECE graduate students, and only for programming assignments 2 – 6. You may discuss high-level ideas with your classmates and the instructor/TA. Re-grade requests must be submitted within a week after assignments are graded.

Ask any questions on Piazza (accessible through Canvas). Before posting a question, please search to ensure your question hasn't already been asked and answered.

Late Policy

Programming assignments have a little leeway:

You are given five (5) free late days that are automatically applied to reduce or eliminate a late deduction (still, you cannot submit any programming assignment more than 48 hours after the deadline). However, you can only use at most 2 free late days per assignment. Consider them as insurance to be used in emergencies, such as when you may be unable to complete an assignment on time due to illness.