Bce C711
Bce C711
2021(Revised 17/4/21)
BCE-C711
COMPILER DESIGN
MM : 100 Sessional : 30
Time : 3 hrs ESE : 70
LTP Credits 4
3 10
OBJECTIVES:
COURSE OUTCOME:
● To realize the basics of compiler design and apply for real time applications.
● To learn about the parsing techniques.
● Apply for various optimization techniques for dataflow analysis.
● To know about compiler generation tools and techniques.
● Understand the application of finite state machines, recursive descent, production rules,
parsing, and language semantics.
● Construct the intermediate code representations and generation.
● Understand the major phases of compilation and to understand the knowledge of Lex
tool & YAAC tool.
NOTE: The question paper shall consist of two sections A and B. Section A contains 10 short
type questions of 6 marks each and student shall be required to attempt any five questions.
Section B contains 8 long type questions of ten marks each and student shall be required to
attempt any four questions. Questions shall be uniformly distributed from the entire syllabus.
Faculty of Engineering & Technology, GKV, Haridwar Computer Science & Engineering
149
UNIT-I
UNIT- II
Compiler Structure: Compiler and translator, various phases of compiler, pass structure of
compiler, bootstrapping of compiler.
Lexical Analysis: The role of lexical analyzer, a simple approach to the design of lexical
analyzer, regular expressions, transaction diagram, finite state machines, Implementation of
lexical analyzer,lexical analyzer generator : LEX, capabilities of lexical analyzer.
UNIT – III
Basic Parsing Techniques : Top down Parser with backtracking, recursive recent parsers,
predicate parsers, bottom-up parsers, Shift-reduce parsing, operator precedence parsers.
UNIT- IV
Intermediate Code Generator: Different intermediate forms - Three address code, Quadruplex
and triples, syntax direct translation mechanism and attributed definition. Translation of
Declaration, Assignment, Control flow, Boolean expression, Array in arithmetic expression,
produced calls, case statement, postfix translation.
UNIT – V
Code Optimization and Code Generation: Local optimization, loop, peephole optimization,
basic blocks and flow graphs DAG, data flow analyzer, machine model, order of evaluation,
register allocation of code selection.
Error Detection and Recovery: Lexical phases error, syntactic phase errors, semantic errors.
TEXT BOOKS:
Alfred V Aho, Jeffrey D. Ullman, Principles of Compiler Design, Narosa.
V. Aho, R. Sethi and J.D. Ullman, Compiler: Principle, Techniques and Tools, AW.
H. C. Holub, Compiler Design in C, Prentice Hill Inc.
SUGGESTED READINGS:
Apple, Modern Computer Implementation in C : Basic Design, Cambridge press.
V Raghvan, “ Principles of Compiler Design”, TMH.
Kenneth Louden,” Compiler Construction”, Cengage Learning.
Faculty of Engineering & Technology, GKV, Haridwar Computer Science & Engineering
150