Leftmost Derivation
Press Derive.
Leftmost derivation
Parse tree
How it works
A grammar rewrites a nonterminal, written in angle brackets, by the right-hand side of one of its rules. In a leftmost derivation every step rewrites the leftmost nonterminal, until only the characters of the string are left. The parse tree shows the same rules as a hierarchy: each nonterminal with the parts it was rewritten into.