Principles And Techniques Of Compilers
- Sciences
- 400 level
- 3 credit units
- 234 pages
- 16 units
This course introduces the principles and techniques of compiler construction. It covers the key techniques in modern compiler construction, preparing students for industry demands. Students will understand programme analysis and optimisation techniques, improving their programming skills. The course builds a foundation for research in compiler, programme analysis, modelling, and operating systems. Topics include lexical analysis, syntax analysis, code generation, and optimisation.
About this course
- Difficulty
- Intermediate
- Study hours
- 200 hours
- Maths
- Intermediate
- Content
- Theoretical, practical, problem solving
- Practical work
- Yes
- CIT342
- Assignments
- Tutor Marked Assignments
- Final Examination
What you'll read
The real module and unit structure of CIT445, taken from the course material NOUN publishes.
One paragraph, so you can see how it reads
CIT445 · UNIT 2: WHAT IS A COMPILER?
This grammar defines the language where an denotes a string of n consecutive a's. Thus, the language is the set of strings that consist of one or more a's, followed by the same number of b's, and then by the same number of c's.
What you should be able to do
- Recognise classes of grammars, languages, and automata.
- Explain steps in compiling a high-level language.
- Construct major components of a modern compiler.
- Work effectively in teams on software implementation projects.
- Apply code optimisation techniques to improve programme performance.
What it prepares you for
- Compiler Engineer
- Software Developer
- Systems Programmer
- Language Designer
- Performance Analyst
- Software Development
- Operating Systems
- Game Development
- Embedded Systems
- Cybersecurity
- Lex
- Yacc
- Flex
- JLex
Where it gets hard
The units students slow down on, and what makes each one heavy.
- Module 3: Syntax Analysis
Unit 5: LR Parsers
LR parsers require understanding of complex state transitions and lookahead concepts.
- Module 4: Code Generation
Unit 3: Intermediate Code Generation
Intermediate code generation involves understanding different code representations and their conversions.
A suggested way through it
13 weeks, about 85 hours in total. Yours will differ.
- Week 1Module 1: Introduction to Compilers
Unit 1: Review of Grammars, Languages and Automata · 5 hours
Read the introduction to grammars, languages, and automata.. Understand the syntax and semantics of grammars.. Define alphabet, words, and strings.. Identify strings generated by a particular grammar..
- Week 2Module 1: Introduction to Compilers
Unit 2: What is a Compiler? · 5 hours
Define compiler and its importance in programming.. Distinguish between a translator, compiler, and interpreter.. Discuss challenges in building compilers.. State qualities of compilers.. Describe the architecture of a compiler..
Unit 3: The Structure of a Compiler · 5 hours
List the components of a compiler.. Describe activities at each compilation phase.. Explain cross compilation.. Analyse hand implementation..
- Week 3Module 2: Lexical Analysis
Unit 1: The Scanner · 5 hours
State the role of a lexical analyser.. State the need for a compiler.. Define the scanner.. State the functions of the scanner..
Unit 2: Hand Implementation of Lexical Analyser · 5 hours
List the methods of constructing a lexical analyser.. Describe the input buffering method.. Explain the transition diagram method.. Construct transition diagrams to handle keywords, identifiers, and delimiters..
- Week 4Module 2: Lexical Analysis
Unit 3: Automatic Generation of Lexical Analyser · 5 hours
Define regular expressions (REs).. Define terms like tokens, patterns, lexemes, and attributes.. Distinguish between normal and Lex regular expressions.. Construct Lex-style regular expressions for patterns.. Describe tools for generating lexical analysers..
Unit 4: Implementing a Lexical Analyser · 5 hours
Define finite automata.. Convert REs to NFA.. Convert NFA to DFA..
- Week 5Module 3: Syntax Analysis
Unit 1: Context-Free Grammars · 5 hours
Define context-free grammars (CFGs).. Define and state the roles of a parser.. Describe the concept of ambiguity.. Generate parse trees for sentences.. Verify grammars..
- Week 6Module 3: Syntax Analysis
Unit 2: Bottom-Up Parsing Techniques · 5 hours
Define parsing techniques.. Distinguish between top-down and bottom-up parsing.. Describe shift-reduce parsing.. Define handle.. Analyse an input string using shift-reduce parsing..
- Week 7Module 3: Syntax Analysis
Unit 3: Precedence Parsing · 5 hours
Define operator grammars and operator precedence grammars.. Explain methods of generating relationships between operators.. Describe operator precedence parsing.. Compute the Wirth-Weber precedence relationship table.. Parse input strings using the precedence relationship table..
- Week 8Module 3: Syntax Analysis
Unit 4: Top-Down Parsing Techniques · 5 hours
Define top-down parsing.. State difficulties with top-down parsing.. Describe recursive descent parsing.. Define LL(k) grammars.. Describe nonrecursive predictive parsing.. Construct a predictive parser for LL(k) grammars.. Use the predictive parsing table to analyse input strings..
- Week 9Module 3: Syntax Analysis
Unit 5: LR Parsers · 5 hours
Define LR(k) grammars.. State advantages and drawbacks of LR parsers.. Construct a simple LR parser.. Distinguish among LR parser types.. Compute LR(0) items.. Construct an NFA for LR(0) items.. Define functions like GOTO, CLOSURE..
- Week 10Module 4: Code Generation
Unit 1: Error Handling · 5 hours
Classify errors based on occurrence stage.. Design a better error handling compiler.. Distinguish between runtime and compile-time errors.. Explain how error detection affects application performance..
- Week 11Module 4: Code Generation
Unit 2: Symbol Tables · 5 hours
Define symbol tables.. State their uses in compilation.. List items entered into symbol tables.. Describe ways of organising the symbol table.. Construct symbol table for block-structured programs.. Describe collision resolution methods in hashing..
- Week 12Module 4: Code Generation
Unit 3: Intermediate Code Generation · 5 hours
Define intermediate representation.. Define three-address code.. State types of three-address code.. Describe stack-based implementation.. Convert between three-address and stack-based code.. Generate intermediate code for Declarations, Expressions, Commands, and Procedures..
- Week 13Module 4: Code Generation
Unit 4: Code Generation · 5 hours
Define code generation.. Explain code generation issues like input, output, memory management, instruction selection.. Describe runtime storage allocation..
Unit 5: Code Optimisation · 5 hours
Define code optimisation.. State criteria for code improving transformation.. List categories of optimisation.. State properties of optimising compilers.. List and describe common optimisation algorithms..
Preparing for the exam
- Create concept maps linking Modules 2-4 compiler phases.
- Practice converting regular expressions to DFAs from Units 2-4 weekly.
- Implement parsing algorithms from Module 3 in a programming language.
- Review symbol table organisation and usage from Unit 2.
- Study code optimisation techniques from Unit 5 and apply them to sample code.
- Focus on understanding the relationships between different compiler phases and their inputs/outputs.
- Allocate equal time to studying each module, but prioritise areas where you feel less confident.
- Form study groups to discuss complex concepts and solve practice problems together.
- Review all TMAs and address any areas where you struggled.
- Get enough rest and manage your time effectively during the exam period.
Questions students ask about this course
What is CIT445 about?
This course introduces the principles and techniques of compiler construction. It covers the key techniques in modern compiler construction, preparing students for industry demands. Students will understand programme analysis and optimisation techniques, improving their programming skills. The course builds a foundation for research in compiler, programme analysis, modelling, and operating systems. Topics include lexical analysis, syntax analysis, code generation, and optimisation.
How many units does CIT445 have?
CIT445, Principles And Techniques Of Compilers, has 16 units across 4 modules, over 234 pages of course material. You can read it one unit at a time.
How many credit units is CIT445?
CIT445 carries 3 credit units, at 400 level in Sciences.
Is CIT445 hard?
CIT445 is rated intermediate level, with intermediate mathematical content. It is mostly theoretical, practical and problem solving work, and it has a practical component.
How long does CIT445 take to study?
About 200 hours of study, spread across its 16 units.
How is CIT445 assessed?
CIT445 is assessed by Assignments, Tutor Marked Assignments and Final Examination.
What do I need before starting CIT445?
CIT342
What can I do with CIT445?
Compiler Engineer, Software Developer, Systems Programmer, Language Designer and Performance Analyst.