Module Identifier CS24210  
Module Title SYNTAX ANALYSIS AND TOPICS IN PROGRAMMING  
Academic Year 2000/2001  
Co-ordinator Dr Mark Ratcliffe  
Semester Semester 1  
Co-Requisite CS21120  
Mutually Exclusive CS34210  
Course delivery Lecture   22 lectures  
  Workshop   (Up to) 4 workshop sessions  
  Practical   (Up to) 4 x 2 hr sessions  
Assessment Exam   2 Hours Written examination   100%  
  Supplementary examination   Will take the same form, under the terms of the Department's policy.    

General description
This module aims to familiarise students with the concepts required for specifying and implementing programming languages, and to study their practical applications in a variety of contexts.

Aims
This module aims to familiarise students with the concepts required for specifying and implementing programming languages.

Learning outcomes
On successful completion of this course students should be able to:

Syllabus
1. Overview of Language Processing Software - 1 Lecture
Editors, compilers, static analysers, interpreters, text formatting, scripting languages.

2. Assemblers, Linkers and Loaders - 3 Lectures
Assembly languages and machine languages; Single pass and two pass assembly; Linking; Simple absolute loader; Linking loader

3. The structure of a typical compiler - 1 Lecture
Lexical, syntactic and semantic analysis; Optimisation and code generation; Implementation; Symbol tables

4. Lexical Analysis - 3 Lectures, 2 Practicals
Lexemes and tokens; Regular Expressions; Finite Automata; Practical use of a scanner generator

5. Syntactic Analysis - 3 Lectures, 2 Practicals
Context free grammars; Parse trees and abstract syntax trees; Parsing strategies (recursive descent, LL, LR); Practical use of a parser generator

6. Intermediate Languages - 2 Lectures
Abstract syntax trees; Reverse polish notation; 3-address code; Attribute grammars and structural attributes

7. Semantic Analysis - 2 Lectures
Different kinds of semantic analysis; Attribute grammars and semantic attributes

8. Code generation - 3 Lectures
Aims of code generation; Memory management, instruction selection and register allocation; Flow graphs; A simple code generator

9. Optimisation and Optimising Compilers - 2 Lectures
Optimisation of source, intermediate and target code; Safety and profitability of optimisation; Flow graphs and optimisation of intermediate code

10. Applications of Compilation Techniques - 2 Lectures
Markup languages; scripting languages; VLSI

Reading Lists
Books
** Recommended Text
A.V. Aho, R. Sethi, and J.D. Ullman. (1986) Compilers: Principles, Techniques and Tools. Addison-Wesley
** Should Be Purchased
J. Bennett. (1996) Introduction to Compiling Techniques: a first course using ANSI C, lex and Yacc. McGraw-Hill