Derivation Trees

1 min read Updated Fri Apr 24 2026 03:19:45 GMT+0000 (Coordinated Universal Time)

Aka. parse tree. Represents the hierarchical structure of a derivation.

  • Root → start symbol
  • Internal nodes → non-terminals
  • Leaves → terminals

Reading the leaf nodes left-to-right gives the derived string.

Types of Derivations

Leftmost Derivation

Always replace the leftmost non-terminal.

Rightmost Derivation

Always replace the rightmost non-terminal.

Each derivation tree corresponds to one unique leftmost derivation and one unique rightmost derivation.