CS606 Assignment 3 Solution and Discussion

The FIRST of a sentential form is the set of terminal symbols that lead any sentential from derived from the very first sentential form. In this particular case X and Y only derive the empty string and as a result the empty string is the FIRST set of both nonterminal symbols X and Y. The FIRST of S, however, includes “a” as in the first production once can derive a sentential form that starts with an “a” given that X can be replaced by the empty string. X similar reasoning allows you to include “b” in the FIRST(S).
summary: FIRST(X) = {e}, FIRST(Y) = {e}, FIRST(S) = {a, b}The FOLLOW set of a nonterminal symbol is the set of terminals that can appear after that nonterminal symbol in any sentential form derived from the grammar’s start symbol. By definition the follow of the start symbol will automatically include the $ sign which represents the end of the input string. In this particular case by looking at the productions of S one can determine right away that the follow of X includes the terminal “a” and “b” and that the FOLLOW of Y includes the terminal “b”. Given that the nonterminal S does not appear in any productions, not even in its own productions, the FOLLOW of S is only $.
summary: FOLLOW(S) = {$}, FOLLOW(X) = {a, b}, FOLLOW(Y) = {b}.b) YES, because the intersection of the FIRST for every nonterminal symbol in empty. This leads to the parsing table for this LL method as indicated below. As there is no conflict in entry then grammar is clearly LL (1).
[23/01, 21:33] Waqas Ahmad: a b $
S S→XaXb S → Yb
A X→ε X→ε
B Y→ε 
@ramshakanwal
Simple reply the topic and upload file

ab to so hi jana chaye fr

@NabeelChaudhary btay?

@NabeelChaudhary w8 kru k so jau?


mery pas file hai pr mujhy idhr uplod ni krni aa rahi

@NabeelChaudhary plz send me solution file at [email protected]

@NabeelChaudhary bhai agr ap k pas file ha to send kr do plz

@ramshakanwal Give me your email or something i will send you a file

allah hi puchy ga

bta dy file hai k ni plz

@ramshakanwal File hai hi nahi in k pas

@zareen This does not make any sense. I also downloaded this type of sketch from internet. Its so confusing. The thing is our assignment is gone.

plz file send kr dy

@NabeelChaudhary Solution idea posted so please follow these step as required assignment with minimum changes.