On this page:
Introduction
Your Repository
Getting Help
9.1

Assignment 5: Type Checking and Compiling🔗

Due: November 24, 11:59PM

Points: 20 public, 60 semipublic, 20 secret.

Introduction🔗

In this project, you will implement a type checker and a stack machine compiler for SmallC. Your type checker will determine whether a SmallC AST is well-typed, and your compiler will translate a well-typed AST into instructions for a stack machine. Specifically, you will implement:
  • typecheck to determine whether a SmallC expr or stmt is well-typed, reporting a type error if it is not.

  • compile to translate a well-typed SmallC expr or stmt into a sequence of stack machine instructions.

  • execute to run a sequence of stack machine instructions and produce the resulting value.

The README in your repository describes the type system and the instruction set you will use.

Your Repository🔗

A private GitLab repository has already been created for you; you do not need to create one. Its name is built from your UMD directory ID:

https://gitlab.cs.umd.edu/cmsc330-mamat/fall2026/student-repos/p5/typing-stackmachine-<directory-id>

For example, if your directory ID is alice1:

https://gitlab.cs.umd.edu/cmsc330-mamat/fall2026/student-repos/p5/typing-stackmachine-alice1

You can also find it by signing in to gitlab.cs.umd.edu, where the project will be listed among your projects. Clone it with:

mkdir -p ~/cmsc330

cd ~/cmsc330

git clone git@gitlab.cs.umd.edu:cmsc330-mamat/fall2026/student-repos/p5/typing-stackmachine-<directory-id>.git

If you have not set up your GitLab account and SSH key yet, do that first; see Software.

Getting Help🔗

If you cannot see your repository, if the repository listed on Piazza is wrong, or if you get a permission error when cloning, post on Piazza or come to office hours. Do this as soon as you notice the problem: extension requests caused by not being able to obtain the assignment will be denied.