Add BNFC grammar for the patterns
Further development of BNFC