You are on page 1of 4

LNMIIT, Jaipur

Department of Computer Science & Engineering

Programme: Course Title: Course Code:


B. Tech. (CSE) Compiler Design (CD) CSE 437
Type of Course: Prerequisites: Total Contact Hours:
Institute Core Theory of Computation (TOC) 40
Year/Semester: Lecture Hrs/Week: Tutorial Hrs/Week: Practical Hrs/Week: Credits:
rd th
3 /6 3 0 0 3

Learning Objective:
This course provides a basic compiler definition and architecture discussing various phases and
component of compilers. This includes lexical analysis, syntax analysis, semantic analysis, intermediate
code generation, run time environment as well as machine code generation and optimization. Student can
analyze and quantify different potential implementation of high-level programming construct. Also, can
learn the Algorithms and implementation techniques for type-checking, code- generation and
optimization.

Course outcomes (COs):

On completion of this course, the students will have the ability: Bloom’s Level
CO-1 Understand major phases of compilation, lexical analysis, parsing, 2
semantic analysis, code generation, and code optimization
CO-2 Create lexical rules and grammars for a programming language 5
CO-3 Understand different parsing techniques including Top-down and 2
Bottom-up parser
CO-4 Design semantic rules into a parser that performs attribution while 6
parsing.
CO-5 Understand and apply the code optimization techniques to improve the 2, 3
performance of a program in terms of speed & space

Contents Lecture Hours

UNIT – 1 Introduction to compilers

1.1 Compilers, Interpreters, and translators 1


1.2 Structure of a compiler, Lexical Analysis, Syntax analysis, Intermediate Code 1
generation, Optimization, Code generation, Symbol Table 3
1.3 Compiler construction tools, Bootstrapping 1

CSE Department, LNMIIT Jaipur P a g e | 1-4


LNMIIT, Jaipur
Department of Computer Science & Engineering

UNIT –2 Lexical Analysis

2.1 Role of Lexical analysis, Lexical errors, Regular expressions, and Finite state 1
machines
2.2 Token, Patterns and Lexemes, Attributes of Tokens, Specification, and recognition of 2 3
tokens
UNIT-3 Syntax Analysis

3.1 Role of Syntax Analysis, Context-Free Grammars and language definition 1


3.2 Writing a Grammar-Elimination Ambiguity, Algorithms-Elimination of Left 1
Recursion, Left factoring.
3.3 Top-down parsing – Recursive descent parsing, computation of FIRST and FOLLOW 1
3.4 LL(1) Grammars algorithms- Construction of predictive parsing table, Table-driven 1
16
parsing
3.5 Bottom-Up Parsing, Reduction, Handle Pruning 1
3.6 Shift-Reduce Parsing, Conflicts during shift reduce parsing 1
3.7 Simple LR parsers, Items and the canonical collection of LR(0) and LR(0) Automaton 1
3.8 The LR-Parsing Algorithm, Structure of LR Parsing table 2
3.9 Algorithm Constructing SLR parsing tables 1
3.10 The canonical collection of LR(1) items 2
3.11 Constructing canonical LR and LALR parsing tables 2
3.12 Using ambiguous grammars, Implementation of LR parsing tables 2

UNIT-4 Syntax – Directed Translation


Syntax – directed translation schemes, Implementation of Syntax-directed
4.1 1
translators
4.2 Intermediate code, Postfix notation, Parse trees and syntax trees 1
Evaluation orders of Syntax directed definition (SDD)-Dependency
4.3 2
Graphs, S-Attributes, L-Attributes
4.4 Applications of Syntax-directed translation-Construction of Syntax tree, 1 8
4.4 Translation of assignment statements, Boolean expressions. 1
4.5 Statements that alter the flow of control, Postfix translations 1
Symbol Tables: The contents of a symbol table, Data structures for symbol
4.6 1
tables, Representing scope information
UNIT-5 Intermediate –Code generation

Variants of syntax trees-Directed Acyclic graphs for expression, Value


5.1 1
number method for constructing DAGs
5.2 Three-Address Code-Quadruples, Triples 1 4
5.3 Static Single-Assignment form 1

CSE Department, LNMIIT Jaipur P a g e | 2-4


LNMIIT, Jaipur
Department of Computer Science & Engineering

5.4 Control Flow-Boolean expressions, short-circuit code 1


UNIT-6 Code optimization
5.1 Principal sources of Optimization – DAG -Optimization of basic block 2
5.2 Global data flow analysis - Efficient data flow algorithms 2 6
Optimization of Basic blocks-The DAG representation of basic blocks,
5.3 2
Dead code elimination.

Textbook references (IEEE format):

Text Book:

1. Compilers: Principles, Techniques and Tools" (2nd edition) by Alfred V. Aho, Monica S. Lam, Ravi
Sethi, and Jeffery D. Ullman. Addison Wesley, Boston, MA, 2006.

Reference books:

1. Dhamdhere D M, "Compiler Construction Principles and Practice", second edition, Macmillan


India Ltd., New Delhi, 2001.
2. Jean Paul Tremblay, Paul G Serenson, "The Theory and Practice of Compiler Writing", McGraw
Hill, New Delhi, 2001.
3. Dick Grone, Henri E Bal, Ceriel J H Jacobs and Koen G Langendoen, “Modern Compiler
Design”, John Wiley, New Delhi, 2000.
4. Complier Design, K.Muneeswaran, Oxford University press

Evaluation Method
Item Weightage (%)
Quiz 1 15
Mid term 30
Quiz 2 15
End term 40

*Please note, as per the existing institute’s attendance policy the student should have a minimum of 75%
attendance. Students who fail to attend a minimum of 75% lectures will be debarred from the End
Term/Final/Comprehensive examination.

CSE Department, LNMIIT Jaipur P a g e | 3-4


LNMIIT, Jaipur
Department of Computer Science & Engineering

CO and PO Correlation Matrix


CO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO3
CO1 1 2 2 1 2
CO2 1 3 2 2 1
CO3 1 2 2 1 2
CO4 2 3 2 2 2 1
CO5 3 2 2 1 2 2

Last Updated On: 14th January 2021

Updated By: Ram Prakash Sharma, Poulami Dalapati

Approved By:

CSE Department, LNMIIT Jaipur P a g e | 4-4

You might also like