Types of Derivations

There are mainly two types of derivations,

  1. Leftmost derivation
  2. Rightmost derivation

Let Consider the grammar with the production S->S+S | S-S | S*S | S/S |(S)| a

Left Most Derivation

A derivation of a string W in a grammar G is a left most derivation if at every step the left most non terminal is replaced.

Right Most Derivation A derivation of a string W in a grammar G is a right most derivation if at every step the right most non terminal is replaced.

Leave a Reply