PHP parser implementation in python