Context-Free Grammars & Languages

Answer & solution
Answer: C (no official key was published)
1. The matching is E–R, F–P, G–Q, H–S, option C. E requires the same identifier string in declaration and use, modeled by the copy language wcw.
2. F matches counts of formal and actual parameters; an bm cn dm models the two cross-referenced counts. G is modeled by X→XbX | XcX | dXf | g: b and c act as binary operators, d/f as matched opening/closing parentheses, and g as an operand.
3. H is modeled by X→bXb | cXc | ε, which generates even-length palindromes. These are structural analogies, not claims that the small grammars capture every feature of a programming language or all odd-length palindromes.