Rewrite parser to use PLY.