Re: Parsing PHP
| From: | Greg Beaver | Date: | Sat, 26 Jul 2003 08:51:55 +0000 |
| Subject: | Re: Parsing PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156985@lists.php.net to get a copy of this message | ||
Hi Nikhil,
There are a number of choices already out there. In phpDocumentor (http://www.phpdoc.org) is a parser that is based on the tokenizer. Also available in PEAR CVS is the PHP_Parser, which is a generated parser based on PHP's own zend_language_parser.y (http://cvs.php.net/cvs.php/pear/PHP_Parser?login=2)
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Nikhil G. Daddikar wrote:
I am using PHP to develop and web app. The app also has a scripting language for the *end user*. I was thinking if I could expose a very simple subset of PHP to them (foreach, if-then-else, variable assignments and comments) and then simply "eval" it. But I don't want them to use calls like system or do infinite loops etc. that will screw up the system. I was thinking if I had a PHPparser that returns tokens, then I can eliminate the call to unwanted funtions, etc. Any ideas on how I should proceed? Thanks.