Parsing & Syntax Analysis

Your answer
Answer & solution
Official answer: D
Step through it (3 parts)
1. The string c has two parse trees: S→F→c and S→H→c.
2. Thus the displayed grammar is ambiguous and is neither LL(1) nor LR(1). Concretely FIRST(F) and FIRST(H) both contain c, causing an LL conflict; after shifting c, completed F→c and H→c items both reduce on end-of-input, causing an LR reduce/reduce conflict. Therefore D for parsing with this grammar. Its finite language can of course be represented by a different unambiguous grammar S→p|d|c.