Compiler Design Week 5 NPTEL Assignment Answers 2025

NPTEL Compiler Design Week 5 Assignment Answers 2025

1. In shift-reduce parsing, handle is at

a) Top of the stack
b) bottom of the stack
c) Anywhere in the stack
d) Nowhere in the stack

Answer :-  For Answers Click Here 

2. Which of the following conflicts is not possible in shift-reduce parsing

a) Reduce-reduce conflict
b) Shift-reduce conflict
c) Shift-shift conflict
d) None of the other options

Answer :- 

3. Which one of the following is true at any valid state in shift-reduce parsing

a) At the bottom we find the prefixes
b) None of the mentioned
c) Stack contains only viable prefixes
d) Stack consists of viable prefixes

Answer :- 

4. For the grammar
S→ AB| C
A → bA| a
B → abbs | bS | E
C→ bC| E
Follow(A) is

a) a,$
b) a,b,$
c) a, b
d) b,$

Answer :- 

5. Shift reduce parsers are

a) Top down Parser
b) Bottom up Parser
c) May be top down or bottom up
d) None of the mentioned

Answer :- 

6. Shift reduce parsers are

a) Top down Parser
b) Bottom up Parser
c) May be top down or bottom up
d) None of the mentioned

Answer :-  For Answers Click Here 

7. In Operator Precedence parsing handle is

a) Before <•
b) After •>
c) Between <• and •>
d) None of the other options

Answer :- 

8. Bay on intering the rule B → abbs, which of the precedence relations between a and b

(A) a = b only
(B) a = b and b= b
(C) b= a and a = b
(D)b= a and b= b

Answer :- 

9. An operator-precedence parser is a

a) Shift-reduce parser
b) Bottom-up parser
c) Parser constructing derivation in the reverse
d) All the other options

Answer :- 

10. Bottom up parsing involves

a) Shift reduce
b) Handle pruning
c) None of the mentioned
d) Both shift reduce and handle pruning

Answer :- For Answers Click Here 

Leave a Comment