Compiler Design: 1. What Is in The Follow (S) ?
Compiler Design: 1. What Is in The Follow (S) ?
Compiler Design: 1. What Is in The Follow (S) ?
S → aSAb | bSBc
A → +AB | ε
B → *BC | ε
C → aC | d
1
5.
X → YZ
Y → Y + Z {print (‘+’);}
T {Y.val = T.val}
Z → *Y {print (‘*’);} Z
T {Z.val = T.val}
ε
T → num {print(num.val);}
For generating target code how many register will be required apart from accumulator A?
(a) 1 (b) 2
(c) 3 (d) 5
G1: A → A1 | 0A1 | 01
G2: A → 0A | 1
S → aB | aAb
A → bAb | a
B → aB | ε
2
How many back tracks are required to generate the string aab from the above grammar?
(a) 1 (b) 2
(c) 3 (d) 4