Context-free grammar to PDA
Type a grammar and get the pushdown automaton that accepts the same language — the standard three-state construction, where the stack carries out a leftmost derivation. Then run strings through it and watch the stack.
One rule per line, alternatives separated by |. Uppercase letters are variables, ε is the empty string, and the first rule’s variable is the start symbol.
Push the start symbol
The first move puts S on the stack above the bottom marker z₀, without reading input.
A variable on top is replaced by one of its right-hand sides
For every rule A → α there is a move that pops A and pushes α, reading nothing. The machine guesses which rule to use — that is the nondeterminism.
A terminal on top is matched against the input
If the top of the stack is a, the next input symbol must be a; both are consumed.
Accept when only z₀ is left
Every variable has been expanded and every terminal matched, so the input was derived by the grammar.
Why is the result nondeterministic?
Because a grammar does not say which rule to apply next. The PDA tries all of them, so the simulator runs it as an NPDA and shows every live stack.
My grammar makes the run stop with “too many configurations”
Rules that grow the stack without reading input — left recursion such as S → Sa, or S → SS — let the machine expand forever. Rewrite them, for example S → (S)S | ε instead of S → SS | (S) | ε.
What can I use as symbols?
Single characters. Uppercase letters are variables; anything else is a terminal, except the comma, slash and semicolon, which the simulator uses inside transition labels.