Let's say I vreated my own CFG in python, How can I check now if a sentence match this grammar (return true) or it doesn't match it (return false and the wrong element in the grammar), How can I do this ?