In: Computer Science
7. Find the FIRST and FOLLOW sets for the grammar
S --> ABC
A --> a | Cb | ε
B --> c | dA | ε
C --> e | f
Construct LL(1) parsing table from grammar
Note:
--->ANSWER:
1.FIRST:-
2.FOLLOW:-
LL(1) PARSING TABLE:
a | b | c | d | e | f | $ | |
S | S->ABC | S->ABC | S->ABC | S->ABC | S->ABC | ||
A | A->a | A->![]() |
A->![]() |
A->Cb , A->![]() |
A->Cb | ||
B | B->c | B->dA | B->![]() |
B->![]() |
|||
C | C->e | C->f |
Hope it helps, for any queries feel free to ask...
Thanks!