translates a given AST to TSPHP code