Added in a basic validation function for grammars.