CS5031 in 1998/1999

Activity & HandoutsExtra information
C1 - lec1Introduction (postscript)
C2 - lec2Lexical analysis (postscript)
example run of lex calculator
C3 - lab1Lex practical flex manual
hints: strings and comments
ANSI C: characters, pre-processing, syntax
C4 - lec3Syntactic analysis (postscript)
example run of yacc calculator
C5 - lab2Yacc practical byacc manual, including %left etc. & examples
Answers: (a) multiple expressions 1: c & results 2,3,5: data & results 4 6,7 (b)
C6 - lec4Semantic analysis (postscript)
example of dictionary
C7 - lab3Code generation practical  
C8 - lec5Generated Code (postscript)
C9 - lec6
C10 - lec7Phases & Passes, Review  
Here are 2 more handouts, that I will be using in all my lectures, but mainly in the first and last.: phases of compilation (postscript) and a larger example C program (postscript)

2nd week
1997 deadline for both parts was 12/Dec, which would be equivalent to 11/Dec in 1998
25% Compiler:
Lex, Yacc and C practical
if you require help mail pjj@cs.man.ac.uk
hints: grammar, strings and comments, bonus work
Get the basic exercise (worth 70%) marked as soon as you have completed it - preferably by the end of the week. I am happy to mark any bonus work separately.
25% Operating Systems:
written report
January Exam
(18th-29th 1999)
50%Answer 3 questions from 4 in 2 hours 2 questions on Operating Systems
In 1997, these were similar to those set in 1996.
2 questions on Compilers
The 1996 compiler questions are only partly relevant owing to syllabus changes. The 1997 & 1998 questions are in this form:
A question about using lex and yacc (and a dictionary or parse trees or similar) to recognise a simple grammar - similar to the lab exercises & examples sheets.
A question about compiler phases and code generation - e.g. describe what happens in the phases, give ARM code for some C, etc.
Here are the 1997 questions and answers and marking scheme.