Open In App

GATE | GATE CS 2012 | Question 65

Like Article
Like
Save
Share
Report
For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. \epsilon is the empty string, $ indicates end of input, and, | separates alternate right hand sides of productions. CSE_2012_51 CSE_GATE_20122 (A) A (B) B (C) C (D) D

Answer: (A)

Explanation:
First(X) - It is the set of terminals that begin the 
            strings derivable from X.

Follow(X) - It is the set of terminals that can appear
            immediately to the right of X in some sentential
            form.

Now in the above question,

FIRST(S) = { a, b, epsilon}
FIRST(A) = FIRST(S) = { a, b, epsilon}
FIRST(B) = FIRST(S) = { a, b, epsilon}
FOLLOW (A) = { b , a }
FOLLOW (S) = { $ } U FOLLOW (A) = { b , a , $ }
FOLLOW (B) = FOLLOW (S) = { b ,a , $ }

epsilon corresponds to empty string.


Quiz of this Question

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