MCQ · 2 marks · Context Free Languages
GATE CS 2016 CS-2 — Q46
A student wrote two context-free grammars and for generating a single C-like array declaration. The dimension of the array is at least one. For example,
int a[10][3];The grammars use as the start symbol, and use six terminal symbols int ; id [ ] num.
| Grammar | Grammar |
|---|---|
Which of the grammars correctly generate the declaration mentioned above?