Compiler Design Bcs Ai 3d
Compiler Design Bcs Ai 3d
Group- B
(Answer all the following questions) 5x4 = 20
2. a. Generate 3 address code for the following program segment
If (x < y)
b = x;
Else
b = y;
b = b * b;
Group C
(Answer all the following questions) 10x3 = 30
16. a. Write down the functionalities of lexical analysis with a diagram.
b. Find out the FIRST and FOLLOW of the given productions.
S→Aa│Bb│AB
A→Ꜫ │c
B→Ꜫ │d
c. Write down the control flow grapf for the given code:
Page 2 of 4
if (a < 10)
a = a + b;
else
a = a-b;
d. What are the rules to compute FIRST and FOLLOW?
3+2+5+5
19. a. Describe with a block diagram the parsing technique of LL(1) parser. Parsing the string
‘((a))’ using LL(1) parser where the parsing table is given below.
a ( ) $
S S→a S→(L)
L L →(S) L→Ꜫ
Page 3 of 4
Page 4 of 4