Testing BNF grammar