A simple pcfg parser in python