Syntax Analysis10

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
 a        b $
S E1       E2 S → ε
A A → S    A → S error
B B → S    B → S E3

0. The appropriate entries for E1, E2 and E3 are

  • Option : C
  • Explanation :
    E1 : M[S, a] : S → aAbB, S → ε (because first of S contain a and ε)
    E2 : M[S, b] : S → bAaB, S → ε (because first of S contain b and ε)
    E3 : M[b, $] : B → S (because first of B contain ε)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *