It's always good to 'eat your own dog food' by trying to apply your own tools to new real life tasks ...
During my work on cairo_wrapper i stumbled across the need to conditionally compile certain functions into the generated extension based on the freatures enabled in the local cairo installation. Some of the cairo backends like PDF or SVG are optional and may not be available due to lack of certain helper libraries.
Up to now this could only be handled by putting an #if or #ifdef section into the function body, making it return false and throw a warning if a certain feature is not available. The PHP way to handle this would be to not make this function available at all then so that function_exists() can be used within PHP userland code to check for the availability of certain functions/features.
So i introduced a new *if=...* attribute for all code element tags. The *if* attribute takes a valid C preprocessor expression as its argument. The generated code will then have #if wrappers around
the code definition itself and around the registration lines, too, so that an element is never seen by PHP userland in any way if its *if* condition is not met.
Elements with an *if* attribute are:
* <class>
* <constant>
* <function>
* <global>
* <ini>
* <interface>
* <property>
* <resource>