Awesome
Scheme Interpreter
Scheme can be considered a dialect of LISP. This project implements a Scheme Interpreter for RSR5 in C. The project builds off a linkedlist represented as a cons type (Scheme), and uses Value structs(see value.h) to store information about each token seen in the input. These tokenized inputs(generated using the tokenizer in tokenizer.c) are parsed using a modified/simplified recursive descent parser, and are finally interpreted(see interpreter.c for details). The evaluation is done using an environment (and frame) model.
Limitations
The program does not handle all scheme commands. For details, look at the bindings and special forms in interpreter.c.
Usage
To Run:
- Go to Directory
make interpreter < testFile
make memtest < testFile
for memory tests using Valgrind.make clean
to remove all compiled files.
testFile
could be selected from the list of test cases in directory:
test-cases
Credits
This project could not have been completed without help from Ammar Babar. Prof. Jed Yang was an invaluable resource in figuring out problems with the interpreter. All test cases were tested in racket which was an great resource.