Question: Edit: This is finding the first set in predictive parsing. I'm trying to do the exercise at the bottom. I think I've got First(B a):

Edit: This is finding the first set in predictive parsing.
I'm trying to do the exercise at the bottom.
I think I've got First(B a): First (B a) = First(B) - {??} ? {b} = {g,??} - {??} ? {b} = {g,b}
I'd like to know if my approach is correct and how I can calculate First (C b B) and use them both to get First(S). Thank you
Example: SABCICb BIB a FIRST(S) FIRST(AB C) u FIRST(C b B) U FIRST(B a) FIRST(A) FIRST(d a) u First(BC)-{d}FIRST(BC) FIRST(B)-FIRST(g) First {? }-{g, ? } FIRST(C) = FIRST (h) First {? } = {h, ? } Now we can compute: and FIRST(A)-{ d } {g, h, }-{ d, g, h, } Exercise: Compute FIRST(C b B) and FIRST(B a) in order to compute FIRST( S)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
