' CSCI 555 (Functional Programming) Assignment 6 Spring 2007

CSci 555: Functional Programming
Spring Semester 2007

Assignment #6
Due Friday, 4 May 2007


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 files on Blackboard.


UP to CSCI 555 assignments document?


Copyright © 2007, H. Conrad Cunningham
Last modified: Sat May 3 2007