CS 340: Programming Language Design

Fall 2007

David Hovemeyer
Office / Phone
GH 118 / 717-815-6582
Office Hours
M/W 11 AM - 12 PM
T/Th 2 - 3 PM
F 9 - 10 AM
or by arrangement
Class Location
GH 123
Class Times M/W 3:00-4:15 PM



Course Syllabus

Exam 1 from Spring 2007, Solution

Exam 2 from Spring 2007, Solution

Final Exam from Spring 2007, Solution

Articles and Lecture Notes

Regular expression article at Wikipedia

Slide presentation on regular languages by Andrew McCallum, University of Massachusetts.  Slides 22-26 are a good overview of regular languages,

Lecture 1: Regular languages and Regular expressions Revised 9/4

Lecture 2: Finite Automata

Lecture 3: Equivalence of Regular Expressions, NFAs, and DFAs

Lecture 4: Context free languages and grammars

Lecture 5: Pushdown automata and Turing Machines

anbncn.jff - Turning machine that recognizes the language anbncn

Lecture 6: Decidability, The Halting Problem, Intro to Lambda Calculus

Lecture 7: Currying and Recursion in Lambda Calculus


RegeXeX regular expression tutor: fixed version for Windows

RegeXeX sourceforge page (Warning: Windows exe is broken, building from source should work)

JFLAP (automata toolkit - needs Java)

DrScheme (very nice Scheme programming environment)

Ruby Programming Language (we will be using Ruby as an example of a pure Object-Oriented language)

SWI Prolog (implementation of the Prolog language)

tuProlog (Java-based implementation of Prolog)


Assignment File(s) Due
Assignment 1: Regular expressions and finite automata n/a Monday, Sept 17th by 11:59 PM
Assignment 2: Lexical analysis using regular expressions CS340_Assign2.zip Wednesday, Sept 26th by 11:59 PM
Assignment 3: Context-free languages and Turing Machines n/a Wednesday, Oct 3rd by 11:59 PM
Assignment 4: Recursive descent parsing (Updated Oct 29th) CS340_Assign4.zip Wednesday, Oct 31st by 11:59 PM
Assignment 5: Abstract Syntax Trees CS340_Assign5.zip Friday, Nov 23rd by 11:59 PM
Assignment 6: Interpretation using Abstract Syntax Trees Updated Dec 10th CS340_Assign6.zip Tuesday, Dec 11th by 11:59 PM


Date Lab Instructions
Aug 29th
Regular expressions
Run RegeXeX using the following URL:
Sep 4th
Finite automata
Instructions for lab 2
Sep 26th Recursive descent parsing ExpressionParserStart.zip, ExpressionParserSolution.zip
Dec 10th Prolog TuProlog: 2p-2.1.zip