Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46351 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8176 invoked from network); 8 Dec 2009 08:29:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2009 08:29:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=pigulla@boerse-go.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pigulla@boerse-go.de; 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:58783] helo=mx.boerse-go.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/92-21824-26E0E1B4 for ; Tue, 08 Dec 2009 03:29:24 -0500 Received: from localhost (localhost [127.0.0.1]) by mx.boerse-go.de (Postfix) with ESMTP id BC84A4969 for ; Tue, 8 Dec 2009 09:29: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 TYcIRtdLbu-v for ; Tue, 8 Dec 2009 09:29:10 +0100 (CET) Received: from [192.168.1.133] (ludwig.customer.muc.de.colt.net [213.61.79.42]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx.boerse-go.de (Postfix) with ESMTP id A3E204964 for ; Tue, 8 Dec 2009 09:29:10 +0100 (CET) Message-ID: <4B1E0E54.1060903@boerse-go.de> Date: Tue, 08 Dec 2009 09:29:08 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.5) Gecko/20091130 Thunderbird/3.0 MIME-Version: 1.0 To: internals@lists.php.net References: <002a01ca7375$c9374190$5ba5c4b0$@de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] accessing PHPs AST From: pigulla@boerse-go.de (Raphael Pigulla) > pecl/parse_tree (if it (still) works) provides access to the parse > tree of PHP code in the form of XML. The XML can be manipulated and > then transformed back into PHP code. PECL::Parse_Tree is still in alpha state and has not been updated since January 2007, so I don't have too much confidence in it being 5.3 compliant. For now I've opted to approach this from the Java side using DLTK and PDT which is very powerful and fast. Plus, it is my hope that - PDT being a widely used PHP IDE and all - the parser will always be fairly up to date. > What kind of AST transformations are you thinking about? At this point it's only a little side project. Eventually, I hope to build some sort of PHP precompiler for our CI server that can help us with QA and such (e.g., checking pre- and postconditions). It is in a way very similar to AspectPHP, but may very well go beyond what is possible with AOP (at the cost of being not as flexible, obviously). But again, this project is still in a very early stage; I'm just writing the very first prototype to see how far DLTK can take me. regards Raphael