CSE 341 -- Programming LanguagesSpring 2003 |
Department of Computer Science and Engineering, University of WashingtonSteve Tanimoto (instructor) |
Assignment 4Version 1.1 of 4 May |
Building an InterpreterDue date and time: Thursday, May 1 (updated deadline: Monday, May 5 at 12:30 PM), 2003.Turn in this assignment electronically. Details are at the end of this web page. |
Instructions:
Work with a partner in the class to implement an interpreter for
a subset of the LOGO language. LOGO is a programming language intended
for use in introducing K-12 students to computer programming. It was
developed in the early 1970s at Bolt, Beranek and Newman, Inc., in Cambridge,
Massachusetts by Feurzig, Bobrow, and Papert. It has various features
in common with Lisp, and so it's easier to build an interpreter
for LOGO in Lisp than to do it, say, in a lower-level language like C
that doesn't have list manipulation facilities built-in.
For your LOGO subset, you should handle most of the non-graphics parts
of the language. Any support you provide for turtle graphics is optional,
and to use graphics, you would have to get involved with a graphics package such
as Allegro's Common Graphics or the Common Lisp X-Windows graphics
facilities available under Linux.
Your LOGO subset should be capable of handling a recursive factorial
function call, for example. As a guide to what your interpreter
should handle, take a look at the reference manual
for
rLogo, a small Logo system written as a Java applet by
Randall Embry. You don't have to implement any of the commands
listed there under "Drawing" or "Visual Effects".
Under "Programming", the command you should implement are
show, params, to, and make.
If the user enters invalid LOGO code, your program should report
an error but not break out of its LOGO read-eval-print loop.
Policy on using web resources:
You are welcome to consult any available resources you find
on the web. However, the code you write for this assignment
should be YOUR OWN. If you end up using ideas of others that
you find on the web, you should: (1) give credit in your own
program by citing, in a comment and in the documentation, the
author and the web address for the idea or code sample,
(2) explain how you are using that idea or code sample, as in
``this function is modelled after the PARSECOMMAND implementation
in "...
The online submission form for this assignment is on
abstract.cs.washington.edu.
Each team should submit two files: logo.lsp and readme.txt.
logo.lsp is to be a self-contained LISP program containing the code for
the LOGO interpreter. To run the interpreter, after logo.lsp has been
loaded, the user must type "(logo)" at the LISP prompt. The first thing
the interpreter must do, before accepting any user input, is to print out
the students' names. (Points will be deducted for not following this
specification precisely.)
readme.txt is to be a PLAIN TEXT file specifying any assumptions in
LOGO program formatting that were made. (Points will be deducted for any
unspecified formatting assumptions.)