Write grammar except complex class definitions.
Completed grammar and docs.