COURSE DESCRIPTION AND APPLICATION INFORMATION

Course Name Code Semester T+A+L (hour/week) Type (C / O) Local Credit ECTS
Compiler Design CMPE 473 Spring 03+00+00 Elective 3 5
Academic Unit: Faculty of Engineering and NAtural Sciences
Mode of Delivery: Face to face
Prerequisites: None
Language of Instruction: English
Level of Course Unit: Undergraduate
Course Coordinator: Rahim DEHKHARGHANİ & Taner ARSAN
Course Objectives: Introduction to compiler organization and implementation, including formal specifications and algorithms for lexical and syntactic analysis, internal representation of the source program, semantic analysis, run-time environment issues and code generation. Students will write a compiler for a reasonably large subset of a contemporary language, targeted to a virtual machine.
Course Contents: The phases of compilation, lexical analysis, parsing, type checking, JVM code generation, survey of famous Java compilers and discussion of modern compiler issues.
Learning Outcomes of the Course Unit (LO):
  • 1- To be able to write parsers and produce an abstract syntax tree.
  • 2- To be able to analyze and generate code for a programming construct represented by an abstract syntax tree.
  • 3- To be able to document your work with program comments and narratives about design choices, problems and their fixes.
Planned Learning Activities and Teaching Methods: Classroom discussion and in-class learning.


WEEKLY SUBJECTS AND RELATED PREPARATIONS

WeekSubjectsRelated Preperation LO
1 Introduction: compilers vs. interpreters, compiler structure. Lecture notes. 1,2
2 The Java Virtual Machine and its run-time environment. Lecture notes. 1,2
3 A map of the j-- compiler. Lecture notes. 1,2
4 Lexical analysis (scanning). Regular expressions, FSA and DFA. Lecture notes. 1,3
5 Context-free grammars and parsing Lecture notes. 1
6 Top-down parsing. LL(1) parsing. Lecture notes. 1,3
7 Top-down parsing. Recursive descent. Lecture notes. 1,3
8 Using a parser generator. JavaCC Lecture notes. 1,3
9 Midterm Exam Lecture notes. 3,4
10 Semantic analysis. Lecture notes. 2,3
11 Semantic analysis. JVM Code generation. Lecture notes. 2,3
12 JVM Code generation. Lecture notes. 2,3
13 Introduction to Optimization Lecture notes. 2
14 Celebrity compilers Lecture notes. 1,2


REQUIRED AND RECOMMENDED READING

Bill Campbell, Swami Iyer, and Bahar Akbal-Delibaş. Introduction to Compiler Construction in a Java World. Chapman and Hall/CRC Press, 2013. ISBN 1439860882


OTHER COURSE RESOURCES

The Java Language Specification: http://docs.oracle.com/javase/specs/jls/se7/html/index.html
The Java Virtual Machine Specification:
http://docs.oracle.com/javase/specs/jvms/se7/html/index.html
Java 7.0 API: http://docs.oracle.com/javase/7/docs/api/
JavaCC: The Java Parser Generator: https://javacc.java.net
Keith Cooper, Linda Torczon, "Engineering a Compiler", Second Edition, Morgan Kaufmann


ASSESSMENT METHODS AND CRITERIA

Semester RequirementsNumberPercentage of Grade (%)
Homework Assignments 5 40
Midterms / Oral Exams / Quizes 1 20
Final Exam 1 40
Total: 7 100


WORKLOAD

EventsCountDuration (Hours)Total Workload (hour)
Course Hours31442
Homework Assigments5525
Midterms / Oral Exams / Quizes12020
Final Exam14040
Total Workload (hour):127


THE RELATIONSHIP BETWEEN COURSE LEARNING OUTCOMES (LO) AND PROGRAM QUALIFICATIONS (PQ)

# PQ1 PQ2 PQ3 PQ4 PQ5 PQ6 PQ7 PQ8 PQ9
LO1                  
LO2                  
LO3