Next: Converting a PDA to
Up: PUSH-DOWN AUTOMATA
Previous: Formal Definition
  Contents
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 and be its sets of terminal
and non-terminal symbols respectively. Let be the start symbol.
Then we construct the PDA as follows:
- The input alphabet is
- There are only two states, let us call them and , where
- is the start state
- is the only final state
- The stack alphabet is
- The transitions are as follows:
-
- For each grammar rule of the form
, there
is a transition
- For each terminal symbol
, there is a transition
James Power
2002-11-29