Initial work on grammar.

Parsing does not work yet because recognizing line-ends is difficult.
Also, spec is strange and the no-non-terminal-in-rhs thing is probably
going to have to be removed.