Hello Jeremy, On Wed, 2009-03-25 at 10:13 -0700, Jeremy wrote: > 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 > } > }
a little bit off topic here, but PHP_Depend's[1] parser and source graph in branches/0.9.0[2] can be used to detect such issues. It is aware of namespaces and can detect most class/interface language constructs like catch, new, type-hints, static calls etc. Greetings Manuel [1] http://pdepend.org/ [2] http://svn.pdepend.org/branches/0.9.0/ -- Manuel Pichler http://manuel-pichler.de GnuPG Key: 6A5D2258 / B4F9 AA42 925D A4AA 4733 4E39 F48B 809C 6A5D 2258 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php