Parser generator implemented in python