Context free grammar issue at pda
You enforce the property of having an equal number of characters to the left and the right by only having rules that add an equal number of characters.

At the moment, your approach is essentially, "Start with $kyyk$ and add stuff to the left and the right." In this  case, "stuff" is the non-terminal symbols $K$ and&nbsp;$Q$, each of which can expand to any string in $\Sigma^*$. Whenever you're expanding two non-terminals in a context-free language, they're expanded completely independently, so there's no way to control their interaction, e.g., to require that both strings have the same length.  This means that the approach of generating the left-stuff and right-stuff from two  non-terminal symbols can't work.

Instead, you need to take the opposite approach. Start with nothing and simultaneously expand the stuff on the left and right.