Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please specify the correct choice answer 5. Below are the LR(0) sets of items fo

ID: 3597246 • Letter: P

Question

please specify the correct choice answer

5. Below are the LR(0) sets of items for the ambiguous grammar S'-> S S- S.S S-> S.S s- [S] S-> SS S-> SS S-> SS to I S- (S) S- [S] S- [S] S-> S.S to 13 to I Since the grammar is ambiguous, we will have to resolve conflicts in some way. Build a simple-LR parsing table with the following heuristics to resolve conflicts 1. Prefer to shift rather than to reduce 2. Prefer to reduce by any production other than S if possible according to the SLR table-construction ules Construct this SLR parsing table. Then, identify from the list below the state-lookahead combination for which reduction by S is called for 0 O O O a) State 10 on lookahead S b) State I7 on lookahead S c) State I7 on lookahead ] d) State lo on lookahead)

Explanation / Answer

ANSWER

OPTION 1

State I0 on lookahead S.

Because in the i7 grammer there is no extension in the given options ans fourth option is not mentioned in the grammer.

So option 1 is appropriate for the above question

if any query please get back to me

Thank you