An -production is a rule of the form
for some non-terminal (this is also called an erasing rule for ). Usually the main motivation for removing this
type of rule is that we need to apply some algorithm which only works
for grammars with no -productions (such as the
elimination of indirect left-recursion).
A non-terminal is said to be nullable if it can derive the empty
string in one or more steps; that is, if is nullable, then there
exists some derivation
. We need
this concept, since the elimination of an erasing rule for a
non-terminal will have a knock-on effect on every other non-terminal
that can derive it.
In order to eliminate -productions from a grammar we perform the
following:
For every nullable non-terminal :
ie. since we've removed the facility which allows to go to , we must compensate for this everywhere is used on the r.h.s of a production rule..