1 1 vote Consider the following grammar: \[ \begin{array}{l} \mathrm{E} \rightarrow \mathrm{E} / \mathrm{X} \mid \mathrm{X} \\ \mathrm{X} \rightarrow \mathrm{~T}-\mathrm{X}\left|\mathrm{X}^{*} \mathrm{~T}\right| \mathrm{T} \\ \mathrm{~T} \rightarrow \mathrm{~T}+\mathrm{F} \mid \mathrm{F} \\ \mathrm{~F} \rightarrow(\mathrm{E}) \mid \text { id (id stands for identifier) } \end{array} \] The grammar is (i) Unambiguous (ii) Ambiguous (iii) Context-free (iv) Regular Only (ii) and (iii) are true Only (i) and (iii) are true Only (i) and (iv) are true Only (ii) and (iv) are true Compiler Design compiler-design ambiguous-grammar context-free-grammar test-series + – nitish 608 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 2 2 votes Its a CFG because its of type V --> (V+T)* where V is variable and T is terminal. this grammer is ambiguous since there exist two parse tree for a string. id - id * id Only (ii) and (iii) are true. Sandeep Singh answered Dec 27, 2015 • selected Dec 27, 2015 by nitish Sandeep Singh comment Share Follow 0 reply Please log in or register to add a comment.