Open In App

GATE | GATE 2017 MOCK II | Question 57

Like Article
Like
Save
Share
Report

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


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads