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

KIT052-COMPILER-DESIGN

The document outlines the structure and content of a BTECH Compiler Design examination for the academic year 2023-24, consisting of three sections with various questions requiring brief answers, detailed explanations, and problem-solving. It includes topics such as cross compilers, parsing techniques, syntax trees, and code generation. The exam is designed to assess students' understanding of compiler design principles and practices.
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)
15 views

KIT052-COMPILER-DESIGN

The document outlines the structure and content of a BTECH Compiler Design examination for the academic year 2023-24, consisting of three sections with various questions requiring brief answers, detailed explanations, and problem-solving. It includes topics such as cross compilers, parsing techniques, syntax trees, and code generation. The exam is designed to assess students' understanding of compiler design principles and practices.
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

Printed Page: 1 of 2

Subject Code: KIT052


0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

BTECH
(SEM V) THEORY EXAMINATION 2023-24
COMPILER DESIGN
TIME: 3 HRS M.MARKS: 100

Note: 1. Attempt all Sections. If require any missing data; then choose suitably.

SECTION A

1. Attempt all questions in brief.


Q no. Question Marks CO
a. Explain cross compiler with suitable example. 2 1
b. Construct regular expression to accept valid identifier containing letters, 2 1
digits, and underscore.
c. Consider the following grammar. 2 2
S -> aSB | d
B -> b
Compute the number of reduction steps taken by a bottom-up parser
while accepting the string “aaaadbbbb”.
d. Construct the following grammar after removing left recursion: 2 2
S -> Aa | b | ε
A -> Ac | SAd | ε
90

1
13
e. Define the syntax directed definition (SDD) with suitable and simple 2 3
_2

example.

2.
P1

f. Construct the syntax tree for the following expression: 2 3

24
(a*c)+b*((c*a)+d)
4D

5.
g. Compare between static and dynamic scope rule. 2 4
.5
P2

h. Write the short note of Activation Record with their fields. 2 4


17
i. Elaborate the design issues of code generation. 2 5
Q

|1

j. Compute the number of nodes in Directed Acyclic Graph (DAG) for the 2 5
following C code segment executed in the sequence:
7

a = b + c; e = a + 1; d = b + c; f = d + 1; g = e + f;
4
8:
:3

SECTION B
13

2. Attempt any three of the following:


4

Q no. Question Marks CO


02

a. Demonstrate the process of compilation with the help of following 10 1


-2

input: c = a*b+10
01

b. Illustrate the problems associated with top-down parsing. Consider 10 2


4-

some examples to explain how these problems can be resolved.


c. Illustrate the role of syntax directed translation in compiler design. Also 10 3
|2

explain how semantic actions are attached to the production with


example.
d. Explore the various data structures used for the symbol table 10 4
construction.
e. Construct target code for the following expression: 10 5
x:=(a+b)*c+d/(a+b)

1|Page
QP24DP1_290 | 24-01-2024 13:38:47 | 117.55.242.131
Printed Page: 2 of 2
Subject Code: KIT052
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

BTECH
(SEM V) THEORY EXAMINATION 2023-24
COMPILER DESIGN
TIME: 3 HRS M.MARKS: 100

SECTION C
3. Attempt any one part of the following:
a. Construct minimized DFA: 10 1

b. Explore the phases of compiler with a suitable example. 10 1


4. Attempt any one part of the following:
90

1
a. Construct parsing table for the following grammar using LALR parser: 10 2

13
S -> CC C -> aC | b
_2

2.
b. Verify that the following grammar is LL (1) 10 2
P1

S -> AaAb | BbBa A -> ԑ B -> ԑ

24
5. Attempt any one part of the following:
4D

5.
a.
.5
Consider the following grammar and give the syntax directed definition 10 3
P2

to construct parse tree for the input expression 4*7+3*9.


17
Q

E -> E+T | T T -> T*F | F F -> num.


|1

Also construct an annotated parse tree according to your syntax directed


definition.
4 7

b. Determine the quadruples, triples, and indirect triples for the following 10 3
8:

expression: (x+y) * (y+z) + (x+y+z)


:3

6. Attempt any one part of the following:


13

a. Explain the run-time storage allocation strategies with their merits and 10 4
limitations.
4
02

b. Explain the various types of compile-time errors in phases of compiler. 10 4


7. Attempt any one part of the following:
-2
01

a. Explain what constitutes a loop in a flow graph and how will do you do 10 5
loop optimizations in code optimization of a compiler.
4-

b. Explain the need of data flow analysis in code optimization. Design the 10 5
|2

following C code segments in flow graph:


for(i=1; i<=5; i++)
{ sum=sum+a[i]; }

2|Page
QP24DP1_290 | 24-01-2024 13:38:47 | 117.55.242.131

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