This is a preliminary plan for the course CEN5025 in the Spring of 2007.

Subject to revision (most likely excision!)

Details will expanded as time permits.

 

Text: Slonnenberger & Kurtz (online), articles

 

This course will have 3 major parts: Language paradigms, language features, parsing. These may well overlap each other to some extent.

 

Preliminary

Grammars & EBNF

Language Paradigms

Language paradigms will be explored by reading and creating programs in 3 very distinct languages. (Currently assumed to be: Java, lisp and CLIPS – but this may change!). The student is expected to be able to follow (compute by hand!) programs at the level of the teaching examples and is required to complete the programs listed in each column of the assigned programs table. All solutions will be published for class inspection immediately after the due dates given in class. (No late programs allowed!)The error column will publish errors cases discovered by your peers (or me if necessary).

 

Evaluation: A calculation (TBA) will consider the following:

·      total of completed programs

·      number of persons completing a given program/version

·      number, uniqueness and viciousness of errors

·      program ‘elegance’ in a calculation TBA.

 

Learning Examples

 

paradigm

 

Matrix Multiplication

Infinite Arithmetic

Simple parsing

Procedural

JAVA

 

 

 

functional

LISP

 

 

 

String re-writing

CLIPS

 

 

 

 

 

Assigned Programs:  

To do with native code & intrinsic types (no libraries, no Classes (except String?)

 

·      IndexSearch :

given a target value and a list, return integer i if the target value occurs first as the i-th  element of the list (else return -1);

·      Max

            Return the index and value of the largest item in a list

·      Merge

Given an ordering relation R for  items of type T and two lists, A and B of type T, which are in increasing order by R, produce a list C which contains all the items of A and B  and which is in increasing order by R

·      Control break

Given a linear list of numbers each prefixed by a category designator with groups preceded by a group designator, return a list which contains the group designators with detailed items replaced by category totals and which has a new group ‘TOTALS’ at the end with grand totals for all categories

·      Polynomial Evaluation

Given the coefficients of a polynomial in the order of increasing powers of the variable, and given a value of that variable, return the value of the polynomial

·      String Replacement

Given a sequence of words and a word assumed to occur in the text, a list of integers indicating where (in word order) each instance of the word was found.

 

 

The public class record will collate all student work so as to be visible by everyone. Programs with errors will be down-graded. Students who find errors in others work (including mine!) will receive additional credit.

 

‘Public’ Class Record

 

 

Person:

Search

Max

Sort

Control Break

Polynomial evaluation

String replacement

Code

Errors

Code

Errors

Code

Errors

Code

Errors

Code

Errors

Code

Errors

instructor

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Stu1

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Stu2

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Stu3

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

Java

Lisp

CLIPS

 

 

Language Features

 

Text: Slonnenberger

 

Probable Lectures/Readings

Lecture

Reading

Assignments

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PARSING

We will use a parser generator to parse a simple language(s). If time permits, we will also use that parse to solve a language related problem (evaluation, model, flow graph, etc.)

 

Language: TBA

Tools: most likely either ANTLR or Javacc

 

Evaluation: Proper parsing of a set of test cases