Next:
CS5031: System Software
 
Contents
CS5031: System Software -- Compilers
Pete Jinks pjj@cs.man.ac.uk
Introduction
Reading List
Activities
Assemblers and Compilers
Assembler
Language definitions
Grammar (Syntax + Lexical): Representation
Semantics: meaning
Compiler
What happens next?
Library
Linker
Execution and Interpretation
Exercises: ECO
Lexical analysis - Lex
Lex program for a postfix calculator
descriptions of expected inputs
example grammar rules from program:
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
Yacc part
Lex part
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
A typical 1-pass organisation
A typical multi-pass organisation
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
Example C program
Dictionary
Parse Tree
About this document ...
Pete Jinks 2001-02-21