Home / GATE 2017-2018 / GATE CSE :: Discussion

Discussion :: GATE CSE

  1. 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. ε is the empty string, $ indicates end of input, and, | separates alternate right hand sides of productions.
    S → a A b B | b A a B | ε
    A → S
    B → S

    The FIRST and FOLLOW sets for the non-terminals A and B are
  2. A.
    FIRST(A) = {a, b, ε} = FIRST(B) 
    FOLLOW(A) = {a, b} 
    FOLLOW(B) = {a, b, $}
    B.
    FIRST(A) = {a, b, $} 
    FIRST(B) = {a, b, ε} 
    FOLLOW(A) = {a, b} 
    FOLLOW(B) = {$}
    C.
    FIRST(A) = {a, b, ε} = FIRST(B) 
    FOLLOW(A) = {a, b} 
    FOLLOW(B) = Ø
    D.
    FIRST(A) = {a, b} = FIRST(B) 
    FOLLOW(A) = {a, b} 
    FOLLOW(B) = {a, b}

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    -NA-


Be The First To Comment