Consider the grammar with productions , ISRO 2017 S → aSb | SS | ϵThis grammar…
2017
Consider the grammar with productions , ISRO 2017
S → aSb | SS | ϵThis grammar is
- A.
not context-free, not linear
- B.
not context-free, linear
- C.
context-free, not linear
- D.
context free, linear
Attempted by 50 students.
Show answer & explanation
Correct answer: C
The given grammar has productions where the left-hand side is always a single non-terminal (S), which satisfies the definition of a Context-Free Grammar (CFG). However, the production S → SS contains two non-terminals on the right-hand side. A Linear Grammar requires at most one non-terminal per production. Since this condition is violated, the grammar is context-free but not linear.