Prevent empty grammar.

Two common cases: the stream is empty or the stream has not been
rewinded.

Thanks @stephpy for reporting the issue!