edited by
329 views
1 votes
1 votes
An unambiguous grammar has same leftmost and rightmost derivation.

True or False

and how??
edited by

1 Answer

0 votes
0 votes

"An unambiguous grammar has same leftmost and rightmost derivation"

This statement is false, let me take an example, suppose given gammer is (which is certainly unambiguous)

S -> AB
A -> a
B -> b

Suppose our input string is ab

Left Most Derivation
S -> AB -> aB -> ab

Right Most Derivation
S -> AB -> Ab -> ab

Notice Left Most derivation and Right most derivation are not same, still gammer is unambiguous.

Here is the Derivation Tree

edited by

Related questions

1 votes
1 votes
0 answers
1
aditi19 asked May 12, 2019
1,649 views
why do first sets can have epsilon symbol but follow sets don’t?P.S: I’ve a silly doubt :P
0 votes
0 votes
2 answers
2
aditi19 asked Sep 14, 2018
459 views
S->AaA->BDB->b | ɛD->d | ɛwhat is FIRST(S)?
20 votes
20 votes
8 answers
4
Arjun asked Feb 14, 2017
7,733 views
Which of the following statements about parser is/are CORRECT?$\text{Canonical LR}$ is more powerful than $\text{SLR}$$\text{SLR}$ is more powerful than $\text{LALR}$$\te...