Preliminary emacs mode
More semantic analysis work.

- Fail properly on syntax errors, including incomplete parses.
- Add checks for rule uniqueness.
Adding generated parser.