Lecture: Grammars and Parsing

Background Material

Reading

Chapter 2 (Programming Language Syntax) from Scott.

Theme

Context free grammars provide a nice formalism for describing syntax of
programming languages. Moreover, there is a mechanism for automatically
constructing a parser (a recognizer of valid strings in the grammar) from
context free grammars (typically a few additional restrictions are enforced
to make it easier to construct the parser). In this lecture we review
grammars as a means of describing syntax and show how, either by hand or
using automated tools such as bison, to construct a parser from the grammar.