|Subject Area||Software and Information System Engineering|
|Semester||Semester 5 – Fall|
The course provides students with the basic knowledge in the subject of compilers. It initially creates the required theoretic background with the study of grammars, languages, automata and state machines, and also with a review of specific data structures, such as trees, graphs and hash tables, as well as classic traversal and closure algorithms. With this background: The course studies the lexical analysis of a source program and its implementation, by hand as well as automatically with the use of “flex”. It then studies the syntax analysis and the construction of the syntax tree, both by hand – whenever possible – and automatically with the use of “bison”. The parsing algorithms for LL(1), LR(0), SLR(1), LR(k) and LALR(1) grammars are examined in syntax analysis. Analysis of semantics follows syntax analysis, together with its use through attribute grammars, as for instance in type checking. In intermediate code generation, emphasis is given in abstract syntax trees and quadruples. Target code generation is presented next, with its main issues, i.e. instruction selection and register allocation. Finally, the course provides an introduction to code optimization with the study of characteristic examples.
The course includes theoretical and laboratory exercises, as well as a project on a full compiler implementation in C for a programming language that is a simplified version of one of the languages FORTRAN, PASCAL and C++.
The course is introductory to the subject of compilers.
The course material aims at the understanding and acquirement of knowledge of the subject at a high level.
Beyond its main subject, the course, as one of the main courses of the Area of “Software and Information System Engineering”, also aims at a connection of the introductory with the more advanced courses of the Area, and courses of the Areas of “Applications and Foundations of Computer Science” and “Computer Hardware and Architecture”. More specifically, it aims at (a) a more theoretical insight on programming languages and their study tools, through the parsing process; (b) a more applied study of algorithms and data structures through the implementation of each separate translation stage; (c) a closer approach to real code executing on a processor in contrast to the code being programmed at a high level, through the whole translation process; (d) a better understanding of the architecture of the computer executing the code, through the study of the run-time environment and final code execution mechanisms; and (e) a totally practical study of Instruction Set Architectures, through optimizations and final code generation.
Last, and possibly the most important, the course aims at the development of the student ability to design and implement – perhaps for the first time – a large and complicated project, that of a whole compiler, from the very first to the very last translation stage, and also in groups, in order to additionally develop their ability to cooperate with colleagues.
In conclusion, with a successful completion of the course requirements, the student will be in a position to:
- Understand the basic issues of compilers, both in theory and in practice.
- Have the specialized knowledge on basic issues met in compilers, to be able to combine them towards the design of a simple compiler.
- Have the dexterity to apply subjects studied in other core courses, like algorithms, data structures and programming, in the subject of compliers.
- Cooperate with colleagues, in order to create and present a large group programming project.