Re: Re: PHP_ParserGenerator

From: Date: Sat, 04 Oct 2003 01:18:26 +0000
Subject: Re: Re: PHP_ParserGenerator
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22371@lists.php.net to get a copy of this message
I just tested it, yeah, works well, a few comments: - I'd use variable functions rather than switch - PHP's performance on that is a bit of a dog.. eg. function case_1() { ....... } $this->{'case_'.$condition}(); I think I found a 20% increase when doing that on PHP_Parser.. (as PHP doesnt handle large switch/case very effeciently) As far as package proposal - I think in this case I would support voting on the name (which is OK.) - and get it into pear's CVS.. , as far as releasing a package, it would have to wait until most of the PEAR Coding standards are incorporated. eg. File /Class names - case sensitivity Prefixes on Constants. phpdocu comments. methodNames 4space not tabs.. no short if's template.php - could do with being clearer. that it's the template - "template.php.in" Otherwise - amazing :) - how long did it take to port.. - I just got lazy and ported the output layer of my parser :) Regards Alan Greg Beaver wrote:
Hi Arjen, I like the idea of porting the Lemon parser generator, and you've got a great start. However, your code is not yet up to PEAR coding standards. Mainly, naming conventions and yes, documentation is required. In addition, it's really not clear how one would use or even test it. I see parser.php and Parser.php - what are these? They appear to be different versions of the same thing, it's very confusing without any documentation. Unfortunately, hardly anyone has knowledge of both PHP and parser generators (I could count the people I know of on one hand with a few missing fingers), so inline comments are necessary for most to understand what is going on. http://pear.php.net/group/docs/20030904-pph.php This describes how you propose a package here. You will get a better response from others if you read it carefully and follow it. Coding standards are here: http://pear.php.net/manual/en/standards.php Thanks, Greg Arjen Brouwer wrote:
Hi! I'd like to request a PEAR account for committing a new Package. Basicly I ported the Lemon parser generated to PHP and to generate a PHP parser, included some Major changes and here it is: 'PHP_ParserGenerator', the website says I need a 'go' from other developers. So here's the source: http://arjen.instantpublishing.nl/PHP_ParserGenerator.zip I'd like to hear some comment. I'ts not documented but people with knowledge of PHP and Parser Generators can figure it out. If I receive a 'go' I'll document the whole thing, else it's no use for me documenting it. Cheers, Arjen


« previous php.pear.dev (#22371) next »