0% found this document useful (0 votes)
5 views

Compiler Design 18CSC28 (2)

This document is an examination paper for the Compiler Design course at Chaitanya Bharathi Institute of Technology, covering various topics related to compilers. It consists of two parts: Part A with 10 short answer questions and Part B with 10 detailed questions, each requiring in-depth analysis and explanation. The exam assesses knowledge on concepts such as lexical analysis, parsing, code generation, and optimization techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Compiler Design 18CSC28 (2)

This document is an examination paper for the Compiler Design course at Chaitanya Bharathi Institute of Technology, covering various topics related to compilers. It consists of two parts: Part A with 10 short answer questions and Part B with 10 detailed questions, each requiring in-depth analysis and explanation. The exam assesses knowledge on concepts such as lexical analysis, parsing, code generation, and optimization techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Code No.

: 18CSC28
CHAITANYA BHARATHI INSTITUTE OF TECHNOLOGY (Autonomous)
B.E. (CSE) VII Sem (Main) Examination December 2021
Compiler Design
Time: 3 Hours Max Marks: 70
Note: Answer all questions from Part - A and Part – B at one place in the same order.

Part – A (20 Marks)


M CO BT
1 What is cross compiler? Why is bootstrapping required to generate (2) 2 1
cross compilers?
2 What is the role of a Lexical Analyzer in a compiler? (2) 2 1
3 Illustrate left recursion? Eliminate left recursion from the given (2) 3 2
expression AAa | Ab | c | d
4 List the LR(0) items for the following grammar (2) 3 1
S -> aAb / d, A -> AeS/ S
5 State S-attributed definitions and L-attributed definitions. (2) 4 1
6 Define synthesized and inherited attributes. (2) 4 1
7 Explain how dynamic memory allocation is done. (2) 5 2
8 Show the syntax tree and DAG for the following expression. (2) 5 2
(a ∗ b) + (c – d) ∗ (a ∗ b) + b
9 State the properties of data flow analysis. (2) 5 1
10 What is Basic Block in Code Generation? (2) 5 2

Part – B (50 Marks)


M CO BT
11 (a) Analyse the translation of the statement by each phase of the (5) 1 4
compiler with a neat diagram.
position:= initial + rate *60
(b) Explain the different approaches to implement the lexical (5) 2 2
analyzer.
(OR)
12 (a) Distinguish between interpreter and compiler. (5) 2 4
(b) Identify a LEX program to count the number of words, characters, (5) 2 3
blank spaces and lines.

13 (a) Construct FIRST and FOLLOW sets for the following grammar (5) 3 3
S iEtSS’/a S’ eS/E E b.
(b) Write the algorithm for the construction of predictive parsing (5) 3 2
table.
(OR)

Page 1 of 2
Code No.: 18CSC28
14 (a) Define handle. Explain the conflicts that occur in shift reduce (5) 3 2
parsing with example.
(b) Identify an algorithm to construct the SLR parsing table. (5) 3 3

15 (a) Define syntax directed definition. Give and explain the syntax- (5) 4 2
directed definition for a simple desk calculator.
(b) What is the conceptual view of the syntax-directed translation? (5) 4 2
Also explain the construction of syntax trees.
(OR)
16 (a) What are synthesized and inherited attributes? Construct (5) 4 3
annotated parse tree for the input string 5*6+7;
(b) Explain the parser stack implementation of postfix SDT (5) 4 2

17 (a) Explain principles of code optimization. (5) 5 2


(b) Discuss various issues in the code generation. (5) 5 2
(OR)
18 (a) List the types of three-address code statements. (5) 5 3
(b) Explain Peephole optimization. What are its characteristics? (5) 5 2

19 (a) Explain the machine independent optimization techniques with an (5) 5 3


example of each.
(b) Identify the basic blocks in the given below three address code (5) 4 4
and draw the DAG and control flow graph.
i := 0
t2 := 0
L: t2 := t2 + i
i := i + 1
if i < 10 goto L
x := t2
(OR)
20 (a) Analyse the different sources of optimization techniques in detail. (5) 5 4
(b) Explain the fields of activation record with a neat diagram. (5) 5 2
******

Page 2 of 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy