Universitatea Babeş-Bolyai Cluj-Napoca
Facultatea de Matematică şi Informatică
Ciclul de studii: Licenţă
Domeniul: Calculatoare şi tehnologia informaţiei
Programul de studii: Ingineria informatiei - in limba engleza
Limba de predare: Engleză

SYLLABUS

I. General data
Code	Subject	
MIF0005	Advanced  Compiler Design 	

Semester	Hours: C+S+L	Category	Status	
6	2+0+1	speciality	optional	

II. Full status faculty members
Name and	Scientific	Didactic	Chair	Type of activity	
surname	title	title		C	S	L	
MOTOGNA Simona Claudia	Ph.D.	Assoc.Prof.	Programming  Languages and Methods	*			

Associated faculty members
Name and	Scientific	Institution	Type of	Type of activity	
surname	title		position	C	S	L	

III. Course objectives
The course will cover modern mechanisms for compiler implementation, taking into consideration various optimizations for different programming languages. The students should be able to understand compiler design and to implement these techniques.

IV. Course contents
I. Back -end of a compiler:
   I.1 Intermediary code generation
   I.2 Code Optimization
   I.3 Object code generation
II. Language-dependent mechanisms in compiler implementation
   II.1 Functional and logical languages
   II.2 Imperative and object-oriented languages
   II.3 Distributed languages
III. Advanced compiler techniques
   III.1 Virtual machines
   III.2 Garbage collection mechanism
   III.3 Dynamic compilation
IV. Compilers for .NET
   IV.1 .NET architecture basics
   IV.2 program execution scheme in .NET
   IV.3 MSIL - intermediary representation in .NET
   IV.4 CLI - Common Language Infrastructure	

V. Bibliography
1. GRUNE, DICK - BAL, H. - JACOBS, C. - LANGENDOEN, K.: Modern Compiler Design, John Wiley, 2000 
2. MITCHELL, JOHN: Foundations for Programming Languages, MIT Press, 1996
3. MOTOGNA, SIMONA: Metode de proiectare a compilatoarelor, Ed. Albastra, 2006
4. RICHTER, J.: Applied Microsoft .NET Framework Programming, Microsoft Press, 2002
5. LIDIN, SERGE: Inside .NET IL Assembler, Microsoft Press International, 2002
6. STUTZ, DAVID - NEWARD, TED - SHILLING, GEOFF: Shared Source CLI Essentials, O'Reilly UK, 2003
7. Sun Java Systems, [http://docs.sun.com/db/prod/java.sys], 01.09.2004	

VI. Thematic of didactic activities per weeks
Course 1: Review compiler phases. Semantic analysis. Define attribute grammar. [1,4]
Course 2: Attribute grammar evaluators. L-attributed grammars, S-attributed grammars [2,4]
Course 3: Manual methods [2,4]: 
- Control flow graph,
- Symbolic interpretation
- Data flow equations
Course 4: Intermediary code generation [1,2,4]. Three-address code: quadruples, triples
Course 5: Intermediary code optimization [1,4]
Course 6: Object code generation. Optimizations of the object code [1,2,4]
Course 7: Compiler design for imperative and object-oriented languages (I): Identification, Type checking, Type table, Source Language Data Representation & Handling [2]
Course 8: Compiler design for imperative and object-oriented languages (II):, Functions- activation records, Object Type, Inheritance, Polymorphism [2,3]
Course 9: Compiler design for functional languages [2,3]
Course 10: Compiler design for logical languages [2,3]
Course 11: Memory management: Garbage Collection mechanism [2,3,5]
Course 12: Java Language Design [3,5]

Laboratory:
Week1-4: Create an attribute grammar and write a program for attribute evaluation
Week 5: Generating intermediary code
Week 6-8: Apply optimization technique to a fragment of 3 address code
Week 9-10: Object code generation: Consider the output of Lab2. Transform it to object code, using a minimum number of registers, determined based on the number of live variables.
Week 11-12: Prepare and present an article related to course domain.	

VII. Didactic methods used
Exposure: description, explanation, presentation with proofs, introductive presentations
Conversation: Heuristic conversation, debate, dialog, introductive conversations, for consolidating information, for synthesis
Didactical Proof: proofs at the blackboard, with logical steps .
Modeling: using models and patterns. 
Algorithmization: algorithmic description. 
Problematization: QA session, problems and practical situations 
Other methods: case study, individual study, exercise.	

VIII. Assessment
The final grade will take into consideration:
- project (practical) 30%
- presentation (case study + domain review) 20%
- written exam 50%
Foe academic year 2010-2011, see
http://cs.ubbcluj.ro/~motogna/AdvancedCompilerDesign.html	

IX. Additional references
[lex & yacc] - http://dinosaur.compilertools.net/	

	Dean,							Chair head,

	Date,							Course responsible,
							Assoc.Prof. MOTOGNA Simona Claudia, Ph.D.