"Babes-Bolyai" University of Cluj-Napoca
Faculty of Mathematics and Computer Science

Compiler design methods
Code
Semes-
ter
Hours: C+S+L
Credits
Type
Section
MI046
6
2+0+2
6
compulsory
Informatică
Teaching Staff in Charge
Lect. MOTOGNA Simona Claudia, Ph.D., motogna@cs.ubbcluj.ro
Prof. CSORNYEI Zoltan, Ph.D.
Aims
The purpose of this course is a complete presentation of the basic notions and methods used in the design and implementation of the programming languages. The laboratory aims are to construct a compiler for a very simple programming language, using some of the methods introduced in the course.
Content
1. General presentation of the issues of designing and implementing programming languages. Programming languages, interpreters, compilers. General structure of a compiler.
2. Scanner. The role of scanning in the compiling process. The structure and management of the symbol table and of the internal form of the program. Memory management.
3. Parsing: the role of parsing in the compiling process, representing the tree of the syntactical analysis. Top-down parsing methods: LL(1), LL(k) grammars. Bottom-up parsing methods: simple precedence grammars, operator precedence grammars, LR(0), SLR, LR(1), LALR, LR(k) grammars.
4. Intermediary forms of programs: polish forms, quadruples, triples, abstract syntacic tree.Syntax oriented translation of different statements.
5. Semantic analysis. The semantic stack in bottom-up compiling. Semantic actions in top-down compiling. Attribute grammars. Translating the basic constructions from a programming language.
6. Errors in compiling phases.
7. Intermediary code optimization. Basic optimization techniques.
8. Generating object code for different types of computers.
References
1. J.E. Hopcroft, J.D. Ullman - Introduction to Automata Theory, Languages and Computation, Addison Wesley, 1979
2. L.D. Serbanati - Limbaje de programare si compilatoare, Ed. Academiei RSR, 1987
3. A.V. Aho, D.J. Ullman - Principles of computer design, Addison-Wesley, 1978
4. A.V. Aho, D.J. Ullman - The theory of parsing, translation and compiling, Prentice-Hall, Engl. Cliffs., N.J., 1972, 1973
5. D. Gries - Compiler construction for digital computers,, John Wiley, New York, 1971
6. G. Moldovan, V. Cioban, M. Lupea - Limbaje formale si automate. Culegere de probleme, Univ. "Babes-Bolyai", Cluj-Napoca, 1996
Assessment
-laboratory work
-final exam