I was doing this grammar.
The language $L = \{ a^nb^mc^n \mid n,m \geqslant 0 \}$
I wanted to know if it is correct or not.
This is my solution
$S \to aSc\mid B \mid e$
$B \to bB \mid e$
I was doing this grammar.
The language $L = \{ a^nb^mc^n \mid n,m \geqslant 0 \}$
I wanted to know if it is correct or not.
This is my solution
$S \to aSc\mid B \mid e$
$B \to bB \mid e$
Your grammar is correct. You could save one rule if you wish:
$S \to aSc + B$
$B \to bB + e$