convert the parser to Python