Türkçe | English
FACULTY of ENGINEERING / DEPARTMENT of COMPUTER ENGINEERING
(30%) English
Course Catalog
https://www.ktu.edu.tr/bilgisayar
Phone: +90 0462 377 2080
MF
FACULTY of ENGINEERING / DEPARTMENT of COMPUTER ENGINEERING / (30%) English
Katalog Ana Sayfa
  Katalog Ana Sayfa  KTÜ Ana Sayfa   Katalog Ana Sayfa
 
 

BIL4023Compiler Design3+0+0ECTS:4
Year / SemesterFall Semester
Level of CourseFirst Cycle
Status Elective
DepartmentDEPARTMENT of COMPUTER ENGINEERING
Prerequisites and co-requisitesNone
Mode of DeliveryFace to face
Contact Hours14 weeks - 3 hours of lectures per week
LecturerDoç. Dr. Hüseyin PEHLİVAN
Co-LecturerNone
Language of instructionTurkish
Professional practise ( internship ) None
 
The aim of the course:
The course aims to describe the various phases of the compiling process, including lexical analysis, top-down and bottom-up parsing, abstract syntax trees, type checking, intermediate translation, basic blocks and code generation, and teach how to implement some compilation phases by using the compiler-compiler tools such as JavaCC and JTB, which can generate source code in Java programming language.
 
Learning OutcomesCTPOTOA
Upon successful completion of the course, the students will be able to :
LO - 1 : understand the phases of the compilation process.2,3,4,121,3
LO - 2 : write finite automata and grammars for programming language constructs.2,3,4,121,3
LO - 3 : write and execute a scanner, a parser and a type checker for a simple programming language.2,3,4,123
LO - 4 : develop simple programming language interpreters.2,3,4,123
LO - 5 : generate intermediate code for a simple programming language.2,3,4,121,3
LO - 6 : design and implement new programming languages.2,3,4,121,3
LO - 7 : apply compiler techniques to typical software engineering tasks that reading input and taking actions.2,3,4,121,3
CTPO : Contribution to programme outcomes, TOA :Type of assessment (1: written exam, 2: Oral exam, 3: Homework assignment, 4: Laboratory exercise/exam, 5: Seminar / presentation, 6: Term paper), LO : Learning Outcome

 
Contents of the Course
Lexical analysis: Lexical tokens, regular expressions, finite automata, lexical-analyser generators. Parsing: Context-free grammars, predictive parsing, LR parsing, parser generators. Abstract syntax: Semantic actions, abstract parse trees, visitors. Semantic analysis: Symbol tables, type checking. Activation records: stack frames, frames in the MiniJava compiler. Translation to intermediate code: Intermediate representation trees, translation into trees, declaration. Basic blocks and traces: Canonical trees, taming conditional branches. Instruction selection: Algorithms for instruction selection, CISC machines, instruction selection for MiniJava compiler. Liveness analysis: Solution of dataflow equations, liveness in the MiniJava compiler. Register allocation: Coloring by simplification, coalescing, precolored nodes, graph-coloring implementation, register allocation for trees. Code generation: Putting it all together.
 
Course Syllabus
 WeekSubjectRelated Notes / Files
 Week 1Introduction to Translators
 Week 2Lexical Analysis
 Week 3Syntax Analysis (Parsing)
 Week 4Abstract Ayntax
 Week 5Semantic Analysis
 Week 6Activation Records
 Week 7Translation to Intermediate Code
 Week 8Basic Blocks and Traces
 Week 9Mid-term exam
 Week 10Instruction Selection
 Week 11Liveness Analysis
 Week 12Register Allocation
 Week 13Code Generation
 Week 14Dataflow Analysis
 Week 15Loop Optimizations
 Week 16End-of-term exam
 
Textbook / Material
1Appel, A. W., 2002; Modern Compiler Implementation in Java, 2nd ed., Cambridge University Press, 501 p.
 
Recommended Reading
1Cooper, K., Torczon, L. 2003; Engineering a Compiler, 1st ed., Morgan Kaufmann, 801 p.
2Grune, D., Bal, H., Jacobs, C., Langendoen, K. 2000; Modern Compiler Design, Wiley, 736 p.
 
Method of Assessment
Type of assessmentWeek NoDate

Duration (hours)Weight (%)
Mid-term exam 9 2 50
End-of-term exam 16 2 50
 
Student Work Load and its Distribution
Type of workDuration (hours pw)

No of weeks / Number of activity

Hours in total per term
Yüz yüze eğitim 3 14 42
Sınıf dışı çalışma 1 14 14
Arasınav için hazırlık 6 1 6
Arasınav 2 1 2
Ödev 8 1 8
Dönem sonu sınavı için hazırlık 8 1 8
Dönem sonu sınavı 2 1 2
Total work load82