grammar: make sure empty productions get processed properly.
Should have read my thesis more carefully in the first place.

Signed-off-by: Peter Williams <pwil3058@gmail.com>