Subject: Compilers Design Methods	Code: MI046	

Semester	 Hours: C+S+L	Type	 Section	
6	2+0+2	compulsory	Computer Science	

Teaching Staff in Charge	Assoc.Prof. MOTOGNA Simona Claudia, Ph.D., motogna@cs.ubbcluj.ro
Prof. CSORNYEI Zoltan, Ph.D.
Asist. TARTA Adriana Mihaela, adriana@cs.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 a compiler. 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. Presentation and use of Lex.
3. Parsing: the role of parsing in the compiling process, representing the syntax tree. Top-down parsing methods: recursive descendent, LL(1), LL(k) grammars. Bottom-up parsing methods: LR(0), SLR, LR(1), LALR, LR(k) grammars. Presentation and use of LLgen and 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	
Selective 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. MOTOGNA, S. - Metode de proiectare a compilatoarelor, Ed. Albastra, 200	
Assessment	The final grade is computed based on the following formula:
-laboratory work 25%
-final exam 75