Testing grammar ambiguity