How best to parse a simple grammar? How best to parse a simple grammar? python python