You've seen how to implement a Scheme interpreter in Lesson 11 (
mceval.scm). For this project, you will be helping us construct a Python interpreter called Schython (Scheme + Python = Schython).
To get the necessary project files and the spec, type the following into your interpreter:
cp -r ~cs61as/lib/schython/ .
You may replace the
. with whichever directory you want to save your project in.
Here's a breakdown of the files contained inside of
||This is the spec for your Schython project.|
||The file that will load the files needed to test your code. Make sure it is in the same directory as the rest of your Schython files.|
||The code for our object-oriented system. OOP is used to create and manipulate the line-object class in
||The parser for our Schython interpreter. This file breaks down lines of input into Python characters recognizable by the Scheme interpreter. You should edit this file.|
||This file is responsible for evaluating parsed Python code from our
||This file contains all the Scheme representations of Python data types. You should edit this file.|
||A file containing a list of Python functions. Do NOT make changes to this file.|
||The file for your answer to Question 9. You should edit this file.|
||A directory containing some tests that you can run to test your code. They are taken from the examples in
To load the project, type the following into your interpreter:
Each partner will work on nine problems. Five of these (Questions 1, 2, 6, 8, and 9) are common to both partners; the others (Questions 3, 4, 5, and 7) should be completed separately.
Groups will hand in a single completed copy of the project, with one answer for each question. Partners will receive the same score for the common exercises and different scores for the separate questions.
There will be points (indicated in
schython.text) where partners should combine their work. This is necessary in order to move on to the next sections of the project.
If you cannot find a partner and/or wish to work alone, please talk to a TA.
Python is a modern and very popular language used for teaching introductory CS courses, and is the language used in CS 61A. We will go over the basics of the Python language necessary to write the Schython interpreter in the spec. But, if you are interested (this is not at all required for this project), you can take a look at Python's documentation for a more comprehensive breakdown of the language.