- How would you design a context-free grammar for the following language?
$\{p^n \ r^m \ p \ \ b^{m+n} \ \ r^2 ∣ m,n\geq 0\}$
- Derive a Pushdown Automaton that accepts the same language as the CFG.
Any help given would be greatly appreciated as I am completely lost and struggling to get to grips with CFGs.
Here's a grammar. Terminals are lowercase. Nonterminals are uppercase. The starting symbol is $F.$
$F=Gr^2$
$G = pGb | H$
$H = rHb | p$