RE: [PHP-DEV] Access to syntax tree?
| From: | Baptiste Autin | Date: | Wed, 25 Mar 2009 19:52:27 +0000 |
| Subject: | RE: [PHP-DEV] Access to syntax tree? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43471@lists.php.net to get a copy of this message | ||
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