in Compiler Design
291 views
0 votes
0 votes
If the grammar is left recursive then is it grammar is ambiguous???
in Compiler Design
291 views

3 Comments

A grammar is said to be ambiguous if it produces more than one parse tree for some sentence.

0
0
Not necessarily. For instance, $S \rightarrow Sa | a$
0
0
not neccesarily.
grammer is said to be ambiguous if more than one parse tree for any string exists.
by the way when both left as well as right recursion co-exist than there  are more chances of grammer to be ambiguous
for example :E->E+E/E*E/id
it is ambiguous.
0
0

Please log in or register to answer this question.