S->FR
R->*S/∈
F->id
FIRST(S) = FIRST(FR) = FIRST(F) = { id }
For R->*S, FIRST(R) = { * }
For R->∈ , FIRST(R) = { ∈ }, FOLLOW(R) = FOLLOW(S) = { $ }
So both productions will be placed in different column
FIRST(F) = { id }
So above grammer can be parsed by LL(1) and parsing table is as follows:
|
* |
id |
$ |
S |
- |
S->FR |
- |
R |
R->*S |
- |
R->∈ |
F |
- |
F->id |
- |
for 2nd one
S->iEtSS' | a
S'->eS | ∈
E->b
for S->iEtSS', FIRST(S) = { i }
for S->a, FIRST(S) = { a }
for S'->eS, FIRST(S') = { e }
for S'->∈, FIRST(S') = { ∈ } and FOLLOW(S') = FOLLOW(S) = FIRST(S') U { dollar } = { dollar,e }
Since in column e there will be two productions so it cant be parsed using LL(1) parser.
FIRST(E) = { b }
So above grammer cant be parsed by using LL(1) parser