PHP namespace removal / mapping and rewriting identifiers
问题 I'm attempting to automate the removal of namespaces from a PHP class collection to make them PHP 5.2 compatible. (Shared hosting providers do not fancy rogue PHP 5.3 installations. No idea why. Also the code in question doesn't use any 5.3 feature additions, just that syntax. Autoconversion seems easier than doing it by hand or reimplementing the codebase.) For rewriting the *.php scripts I'm basically running over a tokenizer list. The identifier searching+merging is already complete. But I