15-150: Principles of Functional Programming

Lecture 24: Context-Free Grammars and Parsing

Today was a brief introduction to context-free grammars, in the noon lecture. We also showed how to construct a recursive-descent parser for a simple grammar.

The 3pm lecture showed how to produce efficient deterministic finite-state automata for recognizing strings in regular languages.

Key Concepts

Sample Code

Some notes on context-free grammars and parsing

Slides from noon lecture

Slides from 3pm lecture

Code from 3pm lecture: bderiv prep and bderiv live