0% found this document useful (0 votes)
37 views2 pages

Compiler Design May 2024

Uploaded by

gamerrahul5379
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)
37 views2 pages

Compiler Design May 2024

Uploaded by

gamerrahul5379
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: R2031421 R20 SET - 1

III B. Tech I Semester Supplementary Examinations, May/June -2024


COMPILER DESIGN
(Com to CSE(AIML),CSE(AI),CSE(DS),CSE(AIDS),AIDS,AIML,CSD)
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****
UNIT-I
1. a) Demonstrate the diagrammatic representation of a language processing system. [7M]
b) Classify the phases of Compiler? Outline the output of each phase for the [7M]
expression position := initial + rate * 60;
(OR)
2. a) Elaborate specification and recognition of tokens. [7M]
b) Translate the following regular expression (((00)*(11)) +01)* into an NFA. [7M]
UNIT-II
3. a) Apply the FIRST and FOLLOW function rules for the following grammar: [7M]
E→TE’
E’→+TE’ | ε
T→FT’
T’→*FT’ | ε
F→(E) | id
b) Create the LL (1) parsing table for the following grammar. [7M]
S→F
S → (S+F)
F →a
(OR)
4. a) Illustrate the various actions performed by shift-reduce parsers with an [7M]
example.
b) Justify the following grammar is LR (1) but not LALR (1). [7M]
S→Aa|bAc|Bc|bBa
A→d
B→d
UNIT-III
5. a) Explain about bottom-up evaluation S-Attributed definitions with an example. [7M]
b) Evaluate the expressions for the SDD annotated parse tree for the follow [7M]
expressions.
i. 3 * 5 + 4n
ii. 3 * 5 using
(OR)
6. a) List the rules for constructing a syntax tree? Construct a syntax tree for the [7M]
following expression: a * (b + c) – d /2.
b) Explain the specification of simple type checker for statements, expressions [7M]
and functions.
UNIT-IV
7. a) Compare and contrast of static, stack and heap storage allocation strategies. [7M]
b) Explain the data structure used for implementing Symbol Table. [7M]
(OR)
1 of 2

|''|''|||''|'''|||'|
Code No: R2031421 R20 SET - 1

8. a) Importance of a flow graph? Build a flow graph for the following code. [7M]
i=1; sum=0;
while (i<=10)
{
sum+=i;
i++;
}
b) Categorize the objectives of peephole optimization? Explain the different [7M]
techniques used in peephole optimization.
UNIT-V
9. a) Illustrate the machine dependent code optimization. [7M]
b) Create the three-address code for the following program fragment? [7M]
while (A<C and B>D) do
if A=1 then C=C+1
else
while A<=D do
A=A+B
(OR)
10. a) Demonstratethe register descriptor and address descriptor with examples. [7M]
b) Explain how do you calculate the cost of an instruction? Measure the total cost [7M]
of the following target code.
MOV a, R0
ADD b, R0
MOV C, R0
ADD R0,R1
MOV R1,X

2 of 2

|''|''|||''|'''|||'|

You might also like