Credit Hours: 3(3+0)

Pre-requisite: Theory of Automata

Course Learning Outcomes:

At the end of the course students will understand the overall structure of a compiler, and will know significant details of a number of important techniques commonly used. They will be aware of the way in which language features raise challenges for compiler builders.

Textbook:

Compilers: Principles, Techniques, and Tools By Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman, Contributor Jeffrey D. Ullman , Prentice Hall; 2ndEdition (2006). ISBN-10 0321486811

Modern Compiler Design, By Dick Grune, Henri E. Bal, Ceriel J. H. Jacobs, Koen G. Langendoen, Springer; 2ndEdition. (2012). ISBN-10: 1461446988

Assessment Criteria:

Sessional Marks: 20 Marks

  • Quiz 1:                  05 marks
  •  Assignment 1:      10 marks
  • class participation & Presentation:  05 marks

Mid Semester Exam: 30 Marks

Final Semester Exam: 50 Marks

Course Contents:

1. Introduction of compiler, prerequisite of compiler, Course goal,  Compiler, Decompiler, Ethics of Decompilation, Cross Compiler

2. Software Tools,  History of Compiler, Why we study compiler

3. Cousins of Compiler, Structure of Compiler

4. Passes, Single pass compiler, Multi pass compiler, Reducing the number of passes,  Compiler Construction Tools

5. Phases of Compiler,  Overview of all phases of compiler, Example of Compilation

6. Role of Lexical Analyzer,  Issues in Lexical Analyzer,  Lookahead, Tokens,  Attributes for token

7. Parsing,  Three address code

8. Detail of Lexical Analysis, Regular Expressions,  Finite Automata, Conversion of NFA to DFA

9. Implementation of Finite Automata in Code, Transition Diagrams and their implementation.

10. Syntax Analysis, Parsing process, Context free Grammar, Ambiguity,  Parse Tree Construction, Top Down Parsing,

11. Recursive Descent or Predictive Parsing, Top Down Algorithm,  Scanning and Parsing Combined, Intermediate Code Generation

12. Code Optimization

13. Instruction Scheduling: The Instruction-Scheduling Problem, Local List Scheduling, Regional Scheduling

14. Register Allocation: Background Issues, Local Register Allocation and Assignment, Moving Beyond Single Blocks, Global Register Allocation and Assignment.

Time Table:

BSCS 7th Reg (Tuesday 02:00-3:30 Pm & Wednesday 11:00-12:30 Pm)

BSCS 7th Self (Monday 02:00 - 3:30 Pm & Tuesday 12:30 - 02:00 Pm)

PPP BSCS 7th F(Tuesday 11:00 am - 12:30 Pm & Wednesday 09:30 am - 11:00 am)

 

Course Material