Study-Unit Description

Study-Unit Description


CODE CPS2000

 
TITLE Compiler Theory and Practice

 
UM LEVEL 02 - Years 2, 3 in Modular Undergraduate Course

 
MQF LEVEL 5

 
ECTS CREDITS 5

 
DEPARTMENT Computer Science

 
DESCRIPTION The knowledge and experience acquired from this unit prepares students with the ability to specify grammars, generate parsers and code generation routines for custom computer languages. The main topics covered in this unit are: the components of a compiler, lexical analysis and scanners, grammar definitions, top-down and bottom-up parsing algorithms, parser generation with tools such as bison/flex/javacc, intermediate code optimisation and target code generation.

Study-unit Aims

Programming languages and associated compilers are an essential part of many software engineering productivity tools. Compilers transform source programs into a form which can be executed on hardware. It is vital that computing science students understand how these transformations are carried out. Both software correctness and efficiency depend on these transformations. This knowledge becomes critical in a resource aware scenario, where compiler optimisations can make or break a system. This study unit aims to equip students with the required knowledge and practical experience to use and if required build language compilers.

Learning Outcomes

1. Knowledge & Understanding: By the end of the study-unit the student will be able to:

- Describe compiler components
- Explain how computer programs are translated into machine code
- Analyse compiler performance
- Describe and compare scanning algorithms
- Describe and compare parsing algorithms
- Describe a number of compiler optimisation techniques.

2. Skills: By the end of the study-unit the student will be able to:

- Use parser generator tools to generate parsers for programming languages
- Given a specific computing environment, report on the best optimisation strategies to adopt
- Use compiler infrastructure kits to generate target code
- Create simple programming languages and develop compilers for them.

Main Text/s and any supplementary readings

Text book:

- Compilers: Principles, Techniques, and Tools (2nd Edition). Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman. Publisher: Prentice Hall; 2nd edition (September 10, 2006), ISBN-10: 0321486811, ISBN-13: 978-0321486813.

References:

- Flex & Bison: Text Processing Tools. John Levine. Publisher: O'Reilly Media; 1 edition (August 21, 2009), ISBN-10: 0596155972, ISBN-13: 978-0596155971.
- The LLVM on-line documentation library @ http://llvm.org/docs/

 
RULES/CONDITIONS Before TAKING THIS UNIT YOU MUST TAKE CPS1002

 
ADDITIONAL NOTES Students taking this study-unit are assumed to have knowledge of the material covered in the following study-units:
- CPS1002;
- CPS1000 or CPS1011;
- CPS2005;
- CSA1017 or ICS1018.

 
STUDY-UNIT TYPE Lecture, Independent Study & Practicum

 
METHOD OF ASSESSMENT
Assessment Component/s Assessment Due Sept. Asst Session Weighting
Assignment SEM2 Yes 100%

 
LECTURER/S Sandro Spina

 

 
The University makes every effort to ensure that the published Courses Plans, Programmes of Study and Study-Unit information are complete and up-to-date at the time of publication. The University reserves the right to make changes in case errors are detected after publication.
The availability of optional units may be subject to timetabling constraints.
Units not attracting a sufficient number of registrations may be withdrawn without notice.
It should be noted that all the information in the description above applies to study-units available during the academic year 2024/5. It may be subject to change in subsequent years.

https://www.um.edu.mt/course/studyunit