Description
Reading Assignment. Read the following sections in the textbook:
• Section 6.1: Expressions (rest of Chapter as a reference as needed)
• Section 7.1: Subprograms
• Section 7.2: Higher-Order Functions
Programming Homework. The goal of this assignment is to write a “pure AST” interpreter for
MyPL. To complete the assignment, finish the following steps. Note that while the due date is
longer than the rest of the assignments, you should get started on this assignment early to give
yourself enough time to ask questions (and receive a response) before the due date. The extended
due date also gives you the chance to make steady progress (so please don’t try to do this right
before the due date). If you wait until the last minute and have issues, you will likely have to turn
your homework in with the late penalty. If you have questions, please ask them over Piazza, in
class, or else via office hours with the instructor or graders.
1. Download the HW-6 Starter Code. Use the link provided in Piazza to accept the GitHub
Classroom assignment for HW-6. When accepting the assignment, please be sure to link your
account to your name in the roster (if you haven’t done so already). Accepting the assignment
will create a copy of the starter code and place it in a hw-4 repository for you. You will then
need to clone this repository to your local machine. As always, be sure to frequently add,
commit, and push your changes.
2. Add your previous files HW to your repository. You will need to copy some of your header and
cpp files from HW-5 into your HW-6 repository (and working directory). You must submit
all other files (beyond those provided) for your submission to be graded.
3. Implement the Interpreter class (in interpreter.h). Please see the discussion and notes from
class for more details. Note that this class implements the visitor interface from HW-4.
4. Testing your implementation. A set of basic test files are also provided in the test subdirectory. Note that you will need to generate additional tests to ensure your program works
correctly. The graders will also be testing your code for error cases (in addition to the cases
provided).
5. Submit your code. Be sure you have submitted all of your source code to your GitHub repo
for the assignment (again, you should get into the habit of frequently adding, committing,
and pushing your code). In addition to your source code, you must also submit each of
your extended and any additional test files you used for testing. For error cases, submit a
file that contains the error cases you tried (or else a script with the error cases themselves).
1
Note that all necessary files to compile and build your program must be checked in to your
repository. If your homework doesn’t compile, the graders won’t be able to test it for correctness
or completeness.
Homework Submission. All homework must be submitted through GitHub Classroom. A link
for each assignment will be posted on Piazza when the homework is assigned. Be sure all of your
code is pushed by the due date (which you can double check for your repository using the GitHub
website). Each programming assignment is worth 35 points. The points are allocated based on
the following.
• Correct and Complete (25 points). Your code must correctly and completely do the
requested tasks using the requested techniques. Note that for most assignments you will be
provided a partial set of test cases to help you determine a minimal level of correctness. If
your program fails any of the provided test cases you will only receive partial credit. Note
that passing the given test cases does not mean your work is complete nor correct. Your
assignment will also be graded with additional test cases (not provided to you) that will help
the graders determine the extent of your solution and your final score. Note that for C++
code, correctness also implies properly handling the creation and deletion of dynamic memory
(i.e., the absence of memory leaks).
• Evidence and Quality of Testing (5 points). As part of your homework assignments
you must develop additional test cases beyond those given to you to ensure your program is
correct and complete. These test cases must be turned in with your assignment. You will be
graded on the scope and quality of the additional test cases you provide.
• Formatting and Comments (5 points). Your code must be formatted consistently and
appropriately for the language used. For C++, you must follow the provided style guide (see
the course webpage). You must also comment your code and test cases, which at a minimum
must include a file heading (see examples provided), function comments, and meaningfully
selected variable, class, and function names.
2