edited by
667 views
0 votes
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?
edited by

1 Answer

Best answer
1 votes
1 votes
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

Related questions

0 votes
0 votes
1 answer
1
vaishali jhalani asked Nov 21, 2016
1,921 views
If the grammar be left recursive then is it always be ambiguous?
1 votes
1 votes
1 answer
2
learner_geek asked Aug 3, 2017
301 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 votes
1 votes
1 answer
3
1 votes
1 votes
4 answers
4
reena_kandari asked Jan 5, 2017
709 views
Consider the following grammar1)Left Recursive2)Ambiguos3)Left factored4)None of these