Instead of taking the grammar, it now takes a function that creates the
grammar. This allows us to have proper diagnostic handling during the
grammar construction.
Change-Id: Ifbddbda53b24972e5e613b78b72a395bd1a05b2c
The aim is to allow:
1. Better error messages for user mistakes, with some context.
2. Clear distinction between user mistakes and internal errors.
This commit just introduces the base infrastructure in diagnostics.py,
and renames user_assert as check_source_language. The base for
introducing context is here, but not yet used.
Change-Id: Ie386fa42253cf6787f30f9166c54cb2522155849
TN: P303-009