Lecture: Grammars and Parsing
- Regular Expressions and Finite State Machines
(see Lecture 2
and Lecture 3 from CS 360).
- Chapter 2 (Programming Language Syntax) from Scott.
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.
- Grammars and Recursive Descent Parsing
- Shift/Reduce Parsing, Attribute Grammars and yacc/bison
Created: April 3, 2008 (updated May 10, 2012) by jjohnson AT cs DOT drexel DOT DOT edu