The Context sensitive grammar (CSG) is defined as G=(V,Σ,P,S)
In context sensitive grammar, there is either left context or right context (αAβ i.e. α is left context and β is right) with variables.
But in context free grammar (CFG) there will be no context.
For example in production rule
S →0 B S 2 ,
B 0 → 0 B
We cannot replace B until we get B0.
Therefore, CSG is harder to understand than the CFG.
The CFG, CSG and the unrestricted grammar are depicted below −