edited by
1,431 views
0 0 votes
$E→E−T ∣ T$

$T→T/F ∣ F$

$F→(E) ∣ id$

(E is the start symbol)

This grammar is unambiguous but shouldn't it be ambiguous because it has left recursion?

1 Answer

Best answer
1 1 vote
No because there is no relation between ambiguity and left recursion.

Ambiguity means that we can derive two parse tree for same string whereas Left recursion means that the parse tree will grow in leftward direction which will eventually lead to infinite recursion. That is the reason why Left recursive grammars can't be parsed by Top down parsers.
selected by
Position:
Show:

Related questions

0 0 votes
1 1 answer
2.4k
2.4k views
vaishali jhalani asked Nov 21, 2016
2,368 views
If the grammar be left recursive then is it always be ambiguous?
1 1 vote
1 answers 1 answer
545
545 views
learner_geek asked Aug 3, 2017
545 views
A Grammar which is only left recursive or right recursive can be ambiguous grammar???Or it should have both left recursive and right recursive to be ambiguous???
1 1 vote
1 1 answer
1.3k
1.3k views
1 1 vote
4 4 answers
1.6k
1.6k views
reena_kandari asked Jan 5, 2017
1,597 views
Consider the following grammar1)Left Recursive2)Ambiguos3)Left factored4)None of these