Consider the grammar S → AbBaCc | ε A → aAb | ba B → BBC | cb C → cCa | ac…
2020
Consider the grammar
S → AbBaCc | ε
A → aAb | ba
B → BBC | cb
C → cCa | ac
Find the First () of S.
Answer: A. {a, b, ε} — Given Grammar: S → AbBaCc | ε A → aAb | ba B → BBC | cb C → cCa | ac FIRST(A) = { a, b } Since: S → AbBaCc | ε and A does not derive ε, FIRST(S) = FIRST(A) ∪…
- A.
{a, b, ε}
- B.
{ε}
- C.
{a, ε}
- D.
{a, b, c, ε}
Attempted by 327 students.
Show answer & explanation
Correct answer: A
Given Grammar:
S → AbBaCc | ε
A → aAb | ba
B → BBC | cb
C → cCa | ac
FIRST(A) = { a, b }
Since:
S → AbBaCc | ε
and A does not derive ε,
FIRST(S) = FIRST(A) ∪ { ε }
Therefore,
FIRST(S) = { a, b, ε }
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…