283x Filetype PDF File size 0.34 MB Source: sfc.ac.in
CBCS-2020 PG Sem - III Compiler Design
SEMESTER -III
COMPILER DESIGN
THEORY
Programme: PG Max. Hours: 60
Course Code : P20/CSC/DSE/302 Hours per week:4
Course Type : DSE Max. Marks: 100
No. of credits: 4
Course Objective:
1. Learn fundamental concepts and techniques used for developing a simple language
compiler
2. Learn to use a new language to explore the lexical, syntactic and semantic structures of
languages in general
Course Outcomes:
1. To specify and analyse the lexical, syntactic and semantic structures of advanced
language features
2. To separate the lexical, syntactic and semantic analysis into meaningful phases for a
compiler to undertake language translation
3. To write a scanner, parser, and semantic analyser without the aid of automatic generators
4. To turn fully processed source code for a novel language into machine code for a novel
computer
5. To describe techniques for intermediate code and machine code optimisation
6. To design the structures and support required for compiling advanced language features.
7. To design a compiler for a simple programming language
8. To learn working of compiler and non compiler applications
____________________________________________________________________
Department of Computer Science, St. Francis College for Women, Hyderabad - 16
CBCS-2020 PG Sem - III Compiler Design
MODULE I: INTRODUCTION TO COMPILER DESIGN AND PHASES (15 Hrs)
Introduction: language processors, phases of a compiler, a model for a compiler front end,
syntax-directed translation, parsing, a translator for simple expressions, Lexical Analysis: role of
lexical analyzer, input buffering, specification of tokens, Lex lexical analyzer generator, data
structures in compilation. Top-Down Parsing: Introduction, Context free grammars, writing a
grammar, recursive-descent parsing, LL (1) grammars, predictive parsing, preprocessing steps
required for predictive parsing.
MODULE II: OVERVIEW OF BOTTOM-UP PARSING AND SEMANTIC ANALYSIS
(15 Hrs)
Bottom-Up Parsing: shift reduce parsing, SLR parsing, CLR parsing and LALR parsing, error
recovery in parsing, handling ambiguous grammar, parser generator – YACC. Semantic
Analysis: syntax-directed definitions, evaluation order for SDD’s, application of SDT.
MODULE III: INTERMEDIATE CODE GENERATION AND RUNTIME
ENVIRONMENT (15 Hrs)
Intermediate-Code Generation: syntax trees, three-address code, types and declarations,
translation of expressions, type checking. Runtime Environment: storage organization, stack
allocation of space, heap management, storage allocation for arrays, strings and records,
introduction to garbage collection and trace based collection.
MODULE IV: CODE GENERATION AND CODE OPTIMIZATION (15 Hrs)
Code Generation: issues in the design of code generator, target language, addresses in the target
code, basic blocks and flow graphs, optimization of basic blocks, peephole optimization, register
allocation and assignment. Code Optimization: principal sources of optimization, data flow
analysis, constant propagation, partial redundancy elimination, loops in flow graphs.
Text Book:
V. Aho, Monica S. Lam, Ravi Sethi,J. D. Ullman, Compilers Principles, Techniques, &
Tools, (2e)
References:
1. Dick Grune, Henry E. Bal, Cariel T. H. Jacobs, Modern Compiler Design
2. Kenneth C. Louden, Compiler Construction Principles and Practice
3. Thomas w. Parsons, Introduction to Compiler Construction
4. Andrew N. Appel, Modern Compiler Implementation in C 5. John R. Levin, Tony Mason,
Doug Brown
____________________________________________________________________
Department of Computer Science, St. Francis College for Women, Hyderabad - 16
CBCS-2020 PG Sem - III Compiler Design
COMPILER DESIGN
MODEL QUESTION PAPER
THEORY
Course Code: P20/ /CSC/DSE/302 Max. Time: 2 ½ hrs.
Credits : 4 Max. Marks: 60
SECTION - A
I. Answer the following 4 x 10 = 40 M
1. Explain in detail about logical analysis.
OR
2. Explain in detail about Top-Down passing.
3. Explain in detail about SLR& CLR passage.
OR
4. Explain in detail about semantic analysis
5. Describe in detail about intermediate code generation.
OR
6. Describe in detail about stack allocation of space & heap management.
7. Explain in detail about register allocation & assignment in code generation.
OR
8. Explain in detail about partial sources of optimization.
SECTION – B
II. Answer any FIVE: 5 x 4 = 20 M
9. Explain in detail about language processors.
10. Write a short note on predictive passing.
11. Discuss about passes generation – YACC.
12. Describe in detail about handling ambiguous grammar.
13. Write a short note on garbage collection & trace based collection.
14. Write a short note on strings & records.
15. Write a short note on issues in the design of code generation.
16. Explain in detail about loops in flow graphs.
____________________________________________________________________
Department of Computer Science, St. Francis College for Women, Hyderabad - 16
no reviews yet
Please Login to review.