"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.,  motognacs.ubbcluj.ro
Prof. CSORNYEI Zoltan, Ph.D.
Asist. TARTA Adriana Mihaela,  adrianacs.ubbcluj.ro
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. Presentation and use of Lex.
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. Presentation and use of Yacc.
4. Intermediary forms of programs: polish forms, quadruples, triples, abstract syntax tree.
5. Intermediary code optimization. Basic optimization techniques.
6. Generating object code for different types of computers.
7. Errors in compiling phases.
References
1. HOPCROFT, J.E. - ULLMAN, J.E.: Introduction to Automata Theory, Languages and Computation, Addison Wesley, 1979
2. SERBANATI, L.D.: Limbaje de programare si compilatoare, Ed. Academiei RSR, 1987
3. AHO, A.V. - ULLMAN, D.J.: Principles of computer design, Addison-Wesley, 1978
4. AHO, A.V. - ULLMAN, D.J.: The theory of parsing, translation and compiling, Prentice-Hall, Engl. Cliffs., N.J., 1972, 1973
5. GRIES, DAVID: Compiler construction for digital computers, John Wiley, New York, 1971
6. GRUNE, DICK - BAL, H. - JACOBS, C. - LANGENDOEN, K.: Modern Compiler Design, John Wiley, 2000
7. "Lex & Yacc Page." [http://dinosaur.compilertools.net/]
8. MOLDOVAN, GRIGOR - CIOBAN, VASILE - LUPEA, MIHAELA: Limbaje formale si automate. Culegere de probleme, Univ. "Babes-Bolyai", Cluj-Napoca, 1996
Assessment
-laboratory work 25%
-final exam 75%