CSci 555: Functional Programming
Spring Semester 2001

OPTIONAL Assignment #6
Due 4 May 2001 (Revised)


The purpose of this assignment is to develop an interpreter for the simple language described below. Syntactically, the language is similar to the language Lisp.

Syntax. The following extended BNF grammar describes the commands that a user can enter into the interpreter. Nonterminal symbols are shown in uppercase. Terminal symbols are in lowercase. The symbols |, [ ], ^*, and ::= are part of the extended BNF metalanguage. The ^* is the superscript asterisk character denoting zero or more repetitions of the element (i.e., star-closure). The start symbol is COMMAND.

COMMAND  ::=  EXPR  |  ASSIGN  |  quit 
ASSIGN   ::=  ( set VAR EXPR )
EXPR     ::=  VAL
           |  VAR
           |  ( OPTR EXPR EXPR )
OPTR     ::=  +  |  -  |  *  |  /
VAL      ::=  [ - ] UNSIGNED
UNSIGNED ::=  DIGIT DIGIT^*
VAR      ::=  ALPHA ALPHANUM^*

Semantics. A value is assigned to a syntactic element as follows:

Tasks. Implement the following Haskell functions:

Test your functions appropriately and thoroughly. Please format and document your program source code appropriately.

When this assignment is complete, submit a paper listing of your program source code and the screen outputs from executing the program. Be sure that all items submitted are clearly labeled with your name and the assignment number.

Also submit your program source code using MESH at URL http://www.cherry.cs.olemiss.edu/mesh/.


UP to CSCI 555 assignments document?


Copyright © 2001, H. Conrad Cunningham
Last modified: Tue Apr 17 14:19:00 2001