Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46265 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29947 invoked from network); 2 Dec 2009 17:35:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2009 17:35:26 -0000 Authentication-Results: pb1.pair.com header.from=pigulla@boerse-go.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pigulla@boerse-go.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain boerse-go.de from 88.198.85.68 cause and error) X-PHP-List-Original-Sender: pigulla@boerse-go.de X-Host-Fingerprint: 88.198.85.68 mx.boerse-go.de Linux 2.6 Received: from [88.198.85.68] ([88.198.85.68:57120] helo=mx.boerse-go.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/1D-65100-955A61B4 for ; Wed, 02 Dec 2009 12:35:23 -0500 Received: from localhost (localhost [127.0.0.1]) by mx.boerse-go.de (Postfix) with ESMTP id 0CD082BCF for ; Wed, 2 Dec 2009 18:35:19 +0100 (CET) X-Virus-Scanned: amavisd-new at mx.boerse-go.de Received: from mx.boerse-go.de ([127.0.0.1]) by localhost (mx.boerse-go.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yYMaW1nXEX1l for ; Wed, 2 Dec 2009 18:35:09 +0100 (CET) Received: from Pigulla (h-213.61.79.42.host.de.colt.net [213.61.79.42]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx.boerse-go.de (Postfix) with ESMTP id 3F6C03A80 for ; Wed, 2 Dec 2009 18:35:08 +0100 (CET) To: Date: Wed, 2 Dec 2009 18:35:05 +0100 Organization: =?us-ascii?Q?BorseGo_AG?= Message-ID: <002a01ca7375$c9374190$5ba5c4b0$@de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpzdcfHsclKBAIhQG2kstmiJaDCqg== Content-Language: de x-cr-hashedpuzzle: AmJT BVdU BieU CSOE C8U1 EYL/ E53n FDeP FSrz Fe3b FsiQ GHGf GbX0 IYD6 J4Ee Kfh7;1;aQBuAHQAZQByAG4AYQBsAHMAQABsAGkAcwB0AHMALgBwAGgAcAAuAG4AZQB0AA==;Sosha1_v1;7;{B9233AB9-C159-4A91-96D9-91E460EED993};cABpAGcAdQBsAGwAYQBAAGIAbwBlAHIAcwBlAC0AZwBvAC4AZABlAA==;Wed, 02 Dec 2009 17:35:03 GMT;YQBjAGMAZQBzAHMAaQBuAGcAIABQAEgAUABzACAAQQBTAFQA x-cr-puzzleid: {B9233AB9-C159-4A91-96D9-91E460EED993} Subject: accessing PHPs AST From: pigulla@boerse-go.de ("Raphael Pigulla") Hello, I'm trying to alter existing PHP code by transforming its AST. From what I've read, the Zend Engine does a one-pass compile and thus offers no way to access the AST. (Whether this is a good or a bad idea doesn't really matter at this point, so let us stay away from that discussion for now.) Other possible solutions I've come across are phc [1], rphp [2] and PHP Depend [3]. Unfortunately, the first does not support PHP 5.3, the second is still in a *very* early stage of development and the third does not allow 'unparsing' and is not particularly fast either (which is only a minor concern, but still). The last idea I had was approaching this from the Java side and use the parser that comes with PDT [4] or PHPEclipse [5], but I haven't yet figured out how to do this yet, and I'm not even entirely sure if this can be done outside of Eclipse (of course it should, but who knows). As you can see, I haven't really found a satisfactory solution yet, so any help is appreciated. regards raph [1] http://phpcompiler.org/ [2] http://code.roadsend.com/rphp/ [3] http://pdepend.org/ [4] http://www.eclipse.org/pdt/ [5] http://www.phpeclipse.com/