Programming Projects
 University of Texas at San Antonio 
Neal R. Wagner

For courses, see Courses Taught.

Here are a number of programming projects that I used in various computer science courses, mainly undergraduate. A long time ago I particularly liked to have non-trivial programming projects as part of my CS courses. I wanted them to be maximally interesting but without too much busywork -- sort a sweet spot. Over time I got increasingly tired of the problems caused by a single project worth so much of the grade, so I drifted toward more and easier assignments.

List of Projects
Regular Expression Recognizer
Database Management System
Interpreter for Pure Lisp
Simple compiler
Other compilers
Self-replicating C Programs
MIPS single-cycle simulator
Conventional Cryptosystem

Regular Expression Recognizer.
The program should take an input regular expression and an input string. The program then recognizes the first occurrence of a substring described by the regular expression.

The regular expressions can be arbitrarily complicated, involving the operators concatenation, alternation, and star. The "syntactic sugar" of REs in programming languages, such as Perl, is not included as a requirement. This project is good for an undergraduate algorithms or automata course.

Concepts needed: a parser for REs based on a formal grammar, representing an RE with an NFA with epsilon moves, computer representation and construction of an NFA, simulating the actions of an NFA on input (includes epsilon closure).


Database management system based on the relational algebra.
This project builds a true relational DBMS. With it one could create and use arbitrarily complicated relational databases. Of course the ease of use and extra features are entirely missing.


Interpreter for pure Lisp.
This project asks students to write an interpreter for "pure" Lisp. The resulting interpreter included functions with parameters, so it wasn't a completely toy system. This assignment was conceived by William F. Dowling at Drexel University, although it's a standard idea, and he may have gotten it elsewhere. I used the assignment myself at that time, and we worked on it together, but the details were mostly his. The link above gives a solution (in C), but this solution seems to have some problem with "defun". Since it once worked, there must be some simple problem.


Simple compiler (CS3723 Recitations 567).
I was trying to develop a compiler project that illustrated compiler concepts, but was easy enough for Junior-level CS majors to finish in three weekly recitations. (Well, plus a recitation on formal grammars.) Recitations 56, and 7 at the above link are the result, along with Recitation 4 on formal grammars. I taught scanners for compilers separately and earlier (Recitations 23), and I wanted students to be able to do the compiler part even if they hadn't finished the scanner part, so the language (Tiny®) has the property that all tokens are single characters, making the scanner trivial. While limiting, the write-up includes an example source program that generates and prints successive Fibonacci numbers, followed by their prime factorization. The project uses MIPS assembler language as the target. In spite of the simplicity, students still learn how syntax-directed translation works. See Tiny® extensions for extensions to this project: changing to floating point numbers, or adding functions with parameters.


Other compilers.
I started teaching compiler-type courses around 1977. It was usually to undergraduates, emphasizing the front end rather than the back end (code generation, optimization).


Self-replicating C Programs.
This starts half-way down in the recitation (CS2213 Recitation 7). I was fond of this as a way to teach subtleties of C and especially to teach arrays of strings in C.
MIPS single-cycle simulator.
CS 2733: Fall 1998 (labs 8-12), Spring 1999 (labs 8-11), Fall 1999 (labs 9-11).
I used this as a programming project because I was initially basing my course on the course taught the previous semester by Kay Robbins, and she had used such a project. Her project was also in C, and more "object-oriented" than the version I was forcing my students to do. Eventually I got tired of all the copying that was going on with this project, so I switched to easier recitations.


Designing a conventional cryptosystem.
Laws of Cryptography (pages 313-320). Projects to design a conventional stream or block cipher are presented in Appendix C of this (incomplete) online book.