Lecture 1: Grammars and Parsing
Background Material
- Recursion.
- Regular Expressions and Finite State Machines
(see Lecture 2
and Lecture 3 from CS 360).
Reading
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.
Topics
- Grammars and Recursive Descent Parsing
- Shift/Reduce Parsing, Attribute Grammars and yacc/bison
Lecture Slides
Assignments
Created: April 3, 2008 by jjohnson AT cs DOT drexel DOT DOT edu