Professional Documents
Culture Documents
Instructions:
You can help each other but do not copy assignment. In case of PLAGIARISM,
assignment of both the students will be marked as ZERO.
Deadline for assignment submission is Thursday 16, 2019 11:59 AM. NO
ASSIGNMENT WILL BE ACCEPTED AFTER DEADLINE.
1. Perform the leftmost & rightmost derivation for the following Grammars, also construct
their parse tree.
a. Even Language with the given alphabet Σ = {a, b}, string: aabaab
b. E E op E
E id
E num
op + | - | * | /
string: x-2*y
c. S aS
S aSbS
S
String: aaabaab
d. S aB | bA
A a | aS | bAA
B b | bS | aBB
String: aaabbabbba
a. X → XSb / Sa / b
S → Sb / Xa / a
b. S → Aa / b
A → Ac / Sd / ∈
A a | cb |
B C | dA |
Ce|f
b. S’ S $
S w
S a C b
C
C S x C
4. Compute all steps of LL(1) parser
a. S (L) | a
L L,S | S
b. S aB | aC | Sd | S e
B bBC | f
Cg
c. S S a S b | c | Q q
QQm|