CS601 Assignment Solution 1 - Download CS601 Assignment No1 Solution 2022
Question No 1 Part (a):
Derive the expression (a+b)*a+b using different productions.
Production |
Result |
1: S→ S + T |
S+T |
2: T → F |
S+F |
3:F → E |
S+E |
4:E → b |
S+b |
5:S → T |
T+b |
6: T → T * F |
T*F+b |
7: F → E |
T*E+b |
8: E → a |
T*a+b |
9: T → F |
F*a+b |
10: F → (S) |
(S)*a+b |
11: S → S+T |
(S+T)*a+b |
12: T → F |
(S+F)+a+b |
13: F → E |
(S+E)*a+b |
14: E → b |
(S+b)*a+b |
15: S → T |
(T+b)*a+b |
16: T → F |
(F+b)*a+b |
17: F → E |
(E+b)*a+b |
18: E → a |
(a+b)*a+b |
No comments:
Post a Comment