1 votes 1 votes Q. Consider the following grammar : 1. S → XYX 2. X → Yc 3. X → sX 4. X → ε 5. Y → eX Find the first and follow Compiler Design compiler-design parsing first-and-follow descriptive + – kallu singh asked Sep 5, 2017 retagged Jun 21, 2022 by Lakshman Bhaiya kallu singh 381 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes First follow S e,s $ X e,s,€ $,e,c,s Y e $,e,c,s Surya Dhanraj answered Sep 5, 2017 edited Sep 5, 2017 by Surya Dhanraj Surya Dhanraj comment Share Follow See all 4 Comments See all 4 4 Comments reply hs_yadav commented Sep 5, 2017 reply Follow Share Surya Dhanraj first(S)=first(X)={s,e} and epsilon is not generated directly from S.... 0 votes 0 votes Surya Dhanraj commented Sep 5, 2017 reply Follow Share First of S = first of X = s,€ ,e X → Yc ( first of X is first of y = e) X → sX ( first of X = s) X → ε ( first of X is epsilon) Y → eX 0 votes 0 votes hs_yadav commented Sep 5, 2017 reply Follow Share First of S = first of X = s,€ ,e ...but whenever their is '€' in x ...we would substitute it in the transition S.... then S->YX ..now F(S)=F(Y)....if Y does € then in that case we include ,€ in the F(S).... but here ,€ is not directly derived from S.... 0 votes 0 votes Surya Dhanraj commented Sep 5, 2017 reply Follow Share Edited the answer ....Thanks for correcting me... 0 votes 0 votes Please log in or register to add a comment.