GATE | GATE 2017 MOCK II | Question 57

Consider the following CFG

	S -> AaAb | Bb
	A -> ԑ
	B -> ԑ

The above grammar is:

(A) Ambiguous
(B) Left recursive
(C) Left factored
(D) None of these


Answer: (C)

Explanation: The grammar is unambiguous (only one parse tree) , not left recursive ( Non-terminal not present in second and third grammar rule) . It is left factored . It is LL(1).


Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.