Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43464 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1253 invoked from network); 25 Mar 2009 17:13:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2009 17:13:52 -0000 X-Host-Fingerprint: 64.58.161.125 wsip-64-58-161-125.oc.oc.cox.net Received: from [64.58.161.125] ([64.58.161.125:4912] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/C2-30978-F466AC94 for ; Wed, 25 Mar 2009 12:13:52 -0500 Message-ID: <14.C2.30978.F466AC94@pb1.pair.com> To: internals@lists.php.net Date: Wed, 25 Mar 2009 10:13:44 -0700 User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 64.58.161.125 Subject: Access to syntax tree? From: jeremy@pinacol.com (Jeremy) Is there any way to access the parse tree of a PHP file from within PHP? I'm trying to write a code-checking utility to find namespace-related problems in code and alert me to them. Specifically: namespace foo\bar; function foobar() { try { ... } catch(Exception $e) { //nothing will be caught //I forgot to qualify //code silently fails } } I didn't want to put a whole lot of work into this, so I'm trying to avoid having to write in C/flex/ANTLR/etc. There's a bit of grease-monkey internals stuff in PHP so I thought I would check. Thanks, Jeremy