Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Non-terminal First1 Follow1 G { } { } S { } { } X { } { } Y { } { } Z { } { } So

ID: 3619732 • Letter: N

Question

Non-terminal                                      First1                                   Follow1

                       

G                      {                       }                      {                       }

S                      {                       }                       {                       }

X                      {                       }                       {                       }

                        Y                      {                       }                       {                       }

                        Z                      {                       }                       {                       }

Explanation / Answer

(10) 4. Given the following CFG, find the First and Follow set of all nonterminals

1)                  G à S|

2)                  S -> XYZ

3)                  X-> aXa

4)                  X-> bXa

5)                  X-> ?

6)                  Y à cYd

7)                  Y-> ?

8)                  Z-> fZg

9)                  Z-> ?

            Non-terminal                                      First1                                   Follow1

                       

G                      {    a,b,c,f ,|     }                      {      ?                 }

S                      {    a,b,c,f,?       }                       {         |         }

X                      {   a,b,?          }                       {        a,|             }

                        Y                      {         c,?           }                       {      d,|                 }

                        Z                      {         f,?           }                       {        g,|               }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote