Skip to main content
deleted 6 characters in body
Source Link

You have missed one important note. The rule is such

For each production $A→α$ of the grammar, do the following:
For each terminal $a$ in $FIRST(A)$, add $A→α;$ to $M[A,a]$

that is we only consider the elements in first set which is contributed by the production $A→α$ which here is $F→\{id\}$$F→(E)$ ,

so for this rule ie $F→\{id\}$$F→(E)$ the $FIRST(F) = \{(\}$ only

and for $F→id$ , $FIRST(F) = \{id\}$

You have missed one important note. The rule is such

For each production $A→α$ of the grammar, do the following:
For each terminal $a$ in $FIRST(A)$, add $A→α;$ to $M[A,a]$

that is we only consider the elements in first set which is contributed by the production $A→α$ which here is $F→\{id\}$ ,

so for this rule ie $F→\{id\}$ the $FIRST(F) = \{(\}$ only

and for $F→id$ , $FIRST(F) = \{id\}$

You have missed one important note. The rule is such

For each production $A→α$ of the grammar, do the following:
For each terminal $a$ in $FIRST(A)$, add $A→α;$ to $M[A,a]$

that is we only consider the elements in first set which is contributed by the production $A→α$ which here is $F→(E)$ ,

so for this rule ie $F→(E)$ the $FIRST(F) = \{(\}$ only

and for $F→id$ , $FIRST(F) = \{id\}$

Source Link

You have missed one important note. The rule is such

For each production $A→α$ of the grammar, do the following:
For each terminal $a$ in $FIRST(A)$, add $A→α;$ to $M[A,a]$

that is we only consider the elements in first set which is contributed by the production $A→α$ which here is $F→\{id\}$ ,

so for this rule ie $F→\{id\}$ the $FIRST(F) = \{(\}$ only

and for $F→id$ , $FIRST(F) = \{id\}$