Re: PHP_Parser devel update
| From: | Alan Knowles | Date: | Fri, 30 Apr 2004 01:04:40 +0000 |
| Subject: | Re: PHP_Parser devel update | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28592@lists.php.net to get a copy of this message | ||
I've not been following the docblock parser stuff.. - It may be worth considering reducing the scope of the lexer
eg.
rather than trying to tokenize
* @ var string $token Its a token
into
"*", "@", "var", "string", "$token", "Its a token"
just doing the minimal and let preg_match do the rest:
eg. something like:
"* @ var" "string $token Its a token"
Regards
Alan
Greg Beaver wrote:
Hi, For those of you waiting on PHP_Parser, I wanted to let you know where things stand. I've been trying to get the DocBlock parser to work, as I realized that this really must be integrated for PHP_Parser to have any real value, and I have run up against a bad design choice. The docblock lexer was written using phpLex, a nice C#-based php port of csLex by Alan. Unfortunately, I've reached a point of no return beyond which I fear the code will be impossible to understand, let alone debug, so I am going back to the drawing board, and will be doing a hand-written lexer based on some of the lexing principals used in phpDocumentor 1.1 and earlier, as these work quite well and are easier to debug and to customize. phpLex was not designed for the kind of diverse lexing choices needed, and it took me a while to realize this :). I am pretty happy with the generated docblock parser. In any case, the lexer will require a serious amount of time to perfect. Fortunately, I have a whole series of unit tests from the old one that I can use to make the new one happen pronto. The PHP code stuff should be considered quite stable, although I haven't had a chance to merge in the most recent change to zend_language_parser.y (it only affects multiple catch statements on a single try, and so won't be a critical issue any time soon). The only thing that hasn't been unit-tested is global variables (which requires docblock parsing) and using objects instead of an array. Greg