# Clone this repository
$ git clone https://github.com/meganzhao/Scheme-Interpreter.git
# Go into the repository
$ cd Scheme-Interpreter
# Make file
$ make interpreter
You can either run the interface or Scheme files:
$ ./interpreter
# Type in Scheme command, for example:
> (+ 1 2)
3
# To run test file test.eval.input.01
$ ./interpreter < test.eval.input.01
To implement a linked list that will be used throughout the interpreter project.
linkedlist.c linkedlist.h
To create a garbage collector to manage memory usage throughout the interpreter project.
talloc.c talloc.h
To implement a tokenizer for Scheme in C.
tokenizer.c tockenizer.h
To parse the tokens into a syntax tree.
parser.c parser.h
To evaluate the Scheme code. Specifically allow the evaluation of bounded variables, if, let and quote special forms.
interpreter.h interpreter.c
Extend the evaluator's ability to handle define and lambda special forms.
interpreter.h interpreter.c
To support applying Scheme primitive functions implemented in C; to implement a few primitive functions.
interpreter.h interpreter.c
To add a myriad of features to the interpreter including:
interpreter.h interpreter.c
*, -, /, <=, eq?, pair?, and apply.
interpreter.c
=, modulo, zero?, equal?, list, and append.
lists.scm (include list and append) math.scm (include =, modulo, zero?, and equal?)
lambda, let*, letrec, and, or, cond, set!, and begin.
interpreter.c
N/A
The classic core of an interpreter is the read–eval–print loop, a.k.a. REPL. Adding this functionality to our code allows for interactive usage.
tokenizer.c main.c
For example, '(2 2 8) as the shorthand for (quote (2 2 8)) Currently doesn't work for nested lists
tokenizer.c
The expression (load "tofu.scm") reads in the file and excutes the Scheme code within as if it were typed directly as part of the input.
interpreter.c
In a file called lists.scm, implement the following functions (refer to R5RS, Dybvig, or Racket reference for specification) using only special forms and primitives that you've implemented (e.g., car, cdr, cons, null?, pair?, and apply).
lists.scm
To implement the following functions using only special forms and primitives that we've implemented (e.g., +, -, *, /, and <=) in a file called math.scm.
math.scm
- Yitong Chen - yitongc19
- Yingying Wang - yingyingww
- Megan Zhao - meganzhao