-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADMEP1
More file actions
21 lines (18 loc) · 1.38 KB
/
READMEP1
File metadata and controls
21 lines (18 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Compile:
To compile the interpreter lisp.cpp, you can simply run the make fule using the command "make". If this for so
me reason donesn't work, you can compile it using g++ using the c++11 standard:
"g++ -std=c++0x lisp.cpp"
Apparently, stdlinux doesn't support c++11 or higher...
Run:
The makefile creates an executable called "lisp". You can run this using the command "./lisp".
The interpreter expects inputs from std::cin. It will accept a series of lisp expressions separated by
the '$' character, with the last lisp expression ending in "$$". Once you type in a lisp expression followied
by a $ on it's own line, the interpreter will evaluate that expression. If a line evaluates to $$, interpretation stops.
Any spaces or standard lisp characters are accepted by the interpreter. New lines and tabs can be used to
separate lists. If a lisp expression is invalid, an error will be printed instead of it's standard notation.
After the error is printed, the next s-expression is read and printed.
When I run this, I use the command below:
"cat tests.txt | ./lisp"
Basically, I have a file named tests.txt which contains a series of lisp expressions of the form above.
I cat this, printing it to some output point, and pipe that to ./lisp, so the lisp program accepts the file
as input. This is my suggested form of input, but you can also enter the tests manually, or copy-paste.