Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43471 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42948 invoked from network); 25 Mar 2009 19:53:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2009 19:53:52 -0000 Authentication-Results: pb1.pair.com header.from=baptiste.autin@free.fr; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=baptiste.autin@free.fr; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain free.fr from 212.27.42.2 cause and error) X-PHP-List-Original-Sender: baptiste.autin@free.fr X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Linux 2.6 Received: from [212.27.42.2] ([212.27.42.2:46742] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/1B-30978-DCB8AC94 for ; Wed, 25 Mar 2009 14:53:51 -0500 Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 0F0DB4B01D4; Wed, 25 Mar 2009 20:53:43 +0100 (CET) Received: from CANIGOU (vol75-6-82-228-66-150.fbx.proxad.net [82.228.66.150]) by smtp2-g21.free.fr (Postfix) with ESMTP id D5BAB4B01F6; Wed, 25 Mar 2009 20:53:40 +0100 (CET) To: "'Jeremy'" , Date: Wed, 25 Mar 2009 20:52:27 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <14.C2.30978.F466AC94@pb1.pair.com> Thread-Index: AcmtbRyf7+w9c6iPRQe3m7/R36BrUgAFR1vw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Message-ID: <20090325195340.D5BAB4B01F6@smtp2-g21.free.fr> Subject: RE: [PHP-DEV] Access to syntax tree? From: baptiste.autin@free.fr ("Baptiste Autin") References: <14.C2.30978.F466AC94@pb1.pair.com> Other possibility: The PEAR package "PHP_UML" can parse PHP files/folders, and generate the API in the form of a global standard XML file (and/or in the form of a full XHTML documentation). Namespaced code is supported. But the parsed code must be object oriented, not procedural (for now). Perhaps this could help anyway... http://pear.php.net/manual/en/package.php.php-uml.intro.php Baptiste -----Original Message----- From: Jeremy [mailto:jeremy@pinacol.com] Sent: mercredi 25 mars 2009 18:14 To: internals@lists.php.net Subject: [PHP-DEV] Access to syntax tree? 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php