Hello,

For the need of phpAspect, I finished a new pecl extension called
Parse_Tree which generate an XML parse tree from a php source code.
For example:
<?php
if (!extension_loaded('parse_tree')) {
  $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
  dl($prefix . 'parse_tree.' . PHP_SHLIB_SUFFIX);
}
echo generate_parse_tree(__FILE__);
?>

Will output something very ugly like:
<yaxx:T_IF id="4">if</yaxx:T_IF>
<yaxx:CHAR40 id="6">(</yaxx:CHAR40>
<yaxx:expr id="28">
<yaxx:expr_without_variable id="27">
<yaxx:CHAR33 id="8">!</yaxx:CHAR33>
<yaxx:expr id="24">
<yaxx:r_variable id="23">
<yaxx:variable id="20">
<yaxx:base_variable_with_function_calls id="1d">
<yaxx:function_call id="1c">
<yaxx:T_STRING id="a">extension_loaded</yaxx:T_STRING>
<yaxx:CHAR40 id="c">(</yaxx:CHAR40>
etc...

The thing is that I provide with this extension an XSLT stylesheet
able to output php source code from an XML parse tree so the
developers have just to create their own XSLT stylesheet to perform
the operations they want (code optimization, code obfuscation,
whatever...).

I need to test the build on windows and a cvs directory like
pecl/php/parse_tree to but the source code in it.

Best regards,

William
--
William Candillon
Telecom Lille Student
E-mail: [EMAIL PROTECTED] / [EMAIL PROTECTED]
Tel: +33(0) 6 67 99 13 16
Skype: wcandillon
CV: http://wcandillon.netcv.org

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to