Skip to content
Related Articles
Open in App
Not now

Related Articles

GATE | GATE CS 2012 | Question 65

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 14 Sep, 2021
Improve Article
Save Article

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.


(A) A
(B) B
(C) C
(D) D

Answer: (A)


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

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

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!