Due Wednesday April 8, 11:59pm
set!
letrecproc
javac Scheme.javaThat will generate several class files. There are two ways to run the interpreter. If you want to evaluate expressions interactively, type
java Scheme. That will start the
read-eval-print loop much like that of Chez Scheme. To evaluate
expressions saved in a file in batch mode, type java Scheme
filename. That will execute every expression in the file
(provided they don't raise exceptions) and output their results.
Add the following features to the interpreter: #f
and #t constants, the if form, and
boolean primitives <, >, =, zero?, null?. (The
places where to add the code handling primitives are indicated by
the /* blank */ fragments.)
Parser code that handles booleans and conditionals is commented out at the moment (so that you can compile and run the interpreter as it is.) This code will provide hints on how to proceed with the assignment. You will have to uncomment it to test your work.
This file contains a couple of test cases for your interpreter test.ss. Try changing the constant in the second procedure from 1000 to 100000 and see what happens. Why?
As usual. (No automatic grading)