Next:
Introduction
Up:
ho
Previous:
ho
CS5031: System Software -- Compilers
Pete Jinks pjj@cs.man.ac.uk
CS5031: System Software -- Compilers
Pete Jinks pjj@cs.man.ac.uk
Introduction
Reading List
Activities
Assemblers and Compilers
Assembler
Language definitions
Compiler
What happens next?
Exercises: ECO
Lexical analysis - Lex
Lex program for a postfix calculator
descriptions of expected inputs
Lex definitions
Actions, C declarations & code
How Lex is used
Exercises: Lexical Analysis for C
Syntactic analysis - Yacc & Parse Trees
An infix calculator written using Lex and Yacc
input descriptions
Yacc definitions
Actions, C declarations & code:
More Lex declarations and actions
How Lex and Yacc are used together:
Precedence and associativity
Exercises: Grammars for Expressions
Semantic Analysis - Dictionaries
Dictionaries
Using a dictionary
Property entries
Keywords
Exercises: Semantics
Syntax-directed Translation
When to use a tool or technique
How to combine tools and techniques - Passes
Phases of Compilation
A small example - Parse Tree after Semantic Annotation
Example run of lex calculator
Example run of yacc calculator
A larger example illustrating the Phases of Compilation
About this document ...
Pete Jinks 2001-02-21