News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Greg Beaver's Blog:
A parser generator for PHP - *finally*
June 17, 2006 @ 07:19:38

Greg Beaver has a new post today with mentions of a few things, but mainly the work that he's done to create a parser generator in PHP.

About three weeks ago, I looked at the state of the parser generator world out there for PHP, and it is pretty dismal. Antlr3 will theoretically support PHP 5 generation, but it's impossible to find any source in spite of several fruitless hours of googling.

I finally decided that if this is ever going to happen, I'll have to get off my butt and do it. So, two weeks ago, I grabbed the source of the Lemon parser generator from its website

He follows the path he took, using the code from the Lemon parser, translating it into a PHP version, and correcting a few bugs along the way.

In the process, I have a fully working PGN file parser that will make its way into a PEAR proposal as soon as I get around to integrating it with Games_Chess to do full validation of the contents of the PGN file. However, the parser works 100% even with some of the weirdest PGN things I could throw at it.

He finishes off the post with some example code, including a method for using it on the command line. You can grab the code for the project and related files here

Sebastian Bergmann also comments in his blog about the work Greg's done.

0 comments voice your opinion now!
parser generator lemon port pp_parser parser generator lemon port pp_parser


blog comments powered by Disqus

Similar Posts

William Candillon's Blog: The Parse Tree generator

Greg Beaver's Blog: PHP_ParserGenerator and PHP_LexerGenerator

Jeff Moser's Blog: Notes from porting C# code to PHP

Greg Beaver's Blog: PHP_ParserGenerator and PHP_LexerGenerator

Jacob Santos' Blog: PHP Blackjack


Community Events





Don't see your event here?
Let us know!


framework deployment release podcast package bugfix series voicesoftheelephpant opinion language api install symfony introduction list interview tips community laravel library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework