recategorized by
12,739 views
22 votes
22 votes

A context-free grammar is ambiguous if:

  1. The grammar contains useless non-terminals.
  2. It produces more than one parse tree for some sentence.
  3. Some production has two non terminals side by side on the right-hand side.
  4. None of the above.
recategorized by

3 Answers

Best answer
27 votes
27 votes
An ambiguous grammar produces more than one parse tree for any string.

Correct Answer : B.
edited by
1 votes
1 votes

The correct option is B it produces more than one parse tree for some sentence
A context-free grammar is ambiguous if
1. It produces more than one parse tree for some sentence
or
2.It produces more that one leftmost derivation for some sentence
or
3. It produces more than one rightmost derivation for some sentence.

Answer:

Related questions

16 votes
16 votes
4 answers
1
makhdoom ghaya asked Nov 8, 2016
3,697 views
An operator precedence parser is aBottom-up parser.Top-down parser.Back tracking parser.None of the above.
2 votes
2 votes
2 answers
2
Shivam Bhardwaj asked Aug 10, 2017
926 views
Ques. S Aa/bAc/dc A dWhich of them is correct. Please provide detailed information.a) LALR(1) but not SLR(1)b) Both SLR(1) and LALR(1)c) Grammar is Ambiguo...
0 votes
0 votes
1 answer
3
Shyam Singh 1 asked Dec 10, 2016
1,538 views
Every SLR grammar is unambiguous. True or False? Why?