Embedded Systems Group (ES)

Converting Pushdown Automata to Context-Free Grammars

Using this tool, you can convert a given pushdown automaton to an equivalent context-free grammar. In many cases, it is quite simply to construct a pushdown automaton for accepting a certain language while the construction of a context-free grammar is more complicated. In these cases, this tool might be of great help for constructing a suitable context-free grammar. In many cases, it is even LR(1) or even LL(1). The default example below, will accept the language of words that have the same number of occurrences of 'a' and 'b'. The first state mentioned is the initial state and the first symbol for the stack alphabet is considered as the initial symbol on the stack.

See also some example pushdown automata.