Re: PHP_Parser class - any plans?
| From: | Lux | Date: | Thu, 16 May 2002 17:31:51 +0000 |
| Subject: | Re: PHP_Parser class - any plans? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6161@lists.php.net to get a copy of this message | ||
This would definitely be interesting, and I can see many potential uses
for such a class/extension. It would probably be wisest to reuse the
Zend engine as much as possible, for speed reasons, and to try to avoid
duplicating efforts on a likely significantly sized project (if one were
to rewrite the parser entirely in php-land).
Lux
On Thu, 2002-05-16 at 12:19, Simon Willison wrote:
> Are there any plans to put together a PEAR tool for parsing and
> "understanding" PHP scripts? Several times over the past few months I have
> come across situations where such a thing could be useful, mostly related
> to documentation. For example, a well written parser class could allow the
> construction of a tool like lxr (as used on http://lxr.php.net/
> ) for
> "browsing" PHP source code. It could also be very useful for writing
> debuggers, profilers and other development tools.
>
> I have no experience of language parsing at all but I imagine it's a lot
> more complicated than just putting together a few regular expressions. Is
> it even viable to write such a thing in PHP or would it make more sense to
> write it as a C extension (perhaps for PECL) that re-uses some of the
> parsing code from the actual Zend engine?
>
> In fact now that I think about it PHP's built in syntax highlighting
> functions must have access to a parser of some sort. How hard would it be
> to add an interface to this parser (I would have thought this is straying
> in to PHP development territory as opposed to PEAR).
>
> Regards,
>
> Simon Willison
>
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>