next up previous contents
Next: Converting a PDA to Up: PUSH-DOWN AUTOMATA Previous: Formal Definition   Contents

Converting a CFG to a PDA

Every CFG can be converted to an equivalent PDA. The constructed PDA will perform a leftmost derivation of any string accepted by the CFG.

Suppose we are given a CFG and let $T$ and $N$ be its sets of terminal and non-terminal symbols respectively. Let $S$ be the start symbol. Then we construct the PDA as follows:



James Power 2002-11-29