CPSC 201: Introduction to Computer Science

 

Instructor: Carsten Schürmann
Department of Computer Science
Yale University
Time: MWF 11:30-12:20
Room: AKW200

  Home
  Schedule
  Handouts
  Assignments
  Projects
  Links
 
 

Lecture 27

Regular acceptors form the basis for lexical analysis which transforms a list of characters into a list of tokens. The best implementation technique for lexing relies on exceptions, a technique which we introduce in this class.

Furthermore, to get a better feeling for programming with continuations, we develop an acceptor for the language of siamese strings. See code below.


Code: expn.sml. Regular acceptor implemented using exceptions.

Code: twin.sml. Acceptor for the language of Siamese strings.

Reading: Robert Harper. Functional Pearls. Proof-Directed Debugging. Journal of Functional Programming.

Reading: Invitation to Computer Science Chapter 9.2.1