Next:
Grammars and Parsing
Compiler Theory:
Syntax Analysis
Marc Moreno Maza
University of Western Ontario
CS447a - Fall 2004
Date:
2 December 2004
Grammars and Parsing
An introduction to the notion of a grammar
The notion of a grammar
Chomsky classification
Context-free grammars
Parse trees
Elimination of ambiguity.
Elimination of left recursion
Left factoring
Parsing
Top-down parsing
Predictive parsing
Non-recursive implementation of predictive parsing
LL
(1) Grammars
YACC - Yet Another Compiler Compiler
Structure of a YACC source program
A first simple example
The LEX file
The YACC corresponding file
Constructing the parser without Makefile
A detailed example
The file
type.h
The file
expressionTree.l
The file
expressionTree.y
The Makefile
A session
Parsing (II)
Bottom-up parsing
LR
Parsers
About this document ...
Next:
Grammars and Parsing
Marc Moreno Maza
2004-12-02