<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 24 May 2012 04:17:11 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Building a simple Parser and Lexer in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17142</guid>
      <link>http://www.phpdeveloper.org/news/17142</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Sameer Borate</i> shows how to <a href="http://www.codediesel.com/php/building-a-simple-parser-and-lexer-in-php/">create a lexer and parser</a> in PHP to work directly with the tokens of a PHP script.
</p>
<blockquote>
After looking around for a while [for a good resource on compilers] I settled for Terence Parr's <a href="http://www.amazon.com/Language-Implementation-Patterns-Domain-Specific-Programming/dp/193435645X/">Language Implementation Patterns</a>. This is exactly what I needed - bit sized patterns on compiler and parser design with working code. The book provides a recipe style approach, gradually moving from simple to complex compiler/parser design issues. As I primarily work with PHP, I thought of porting some code to PHP to see how it works.
</blockquote>
<p>
He shows examples <a href="http://www.codediesel.com/downloads/lexer-parser">using his custom tool</a> to show a basic lexer output for a list and a complete listing of the code involved. Ultimately, though, he finds that PHP isn't overly suited to the task - anything more than his simple example could be more trouble than it's worth.
</p>]]></description>
      <pubDate>Thu, 17 Nov 2011 11:57:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Erik's Blog: PHP implementation of an LALR1 parser generator]]></title>
      <guid>http://www.phpdeveloper.org/news/13869</guid>
      <link>http://www.phpdeveloper.org/news/13869</link>
      <description><![CDATA[<p>
<i>Erik</i> has <a href="http://sankuru.biz/en/blog/7-figuring-out-compiler-technology/121-php-implementation-of-an-lalr1-parser-generator.html">posted about a new parser he's created</a>, one based on the <a href="http://en.wikipedia.org/wiki/LALR_parser">LALR parser method</a>, that can be <a href="http://sankuru.biz/downloads/lrparsers.zip">downloaded here</a> [zip].
</p>
<blockquote>
Parser tables, along with a lexer table, are the core constituents of any compiler's front end. This LALR parser generator is heavily based on my custom Php version of the <a href="http://en.wikipedia.org/wiki/MapReduce">map/reduce programming technique</a> (functional programming). I will elaborate in future posts, on why I used a map/reduce basis to implement the parser generator.
</blockquote>
<p>
Parsers organize a set of tokens based on the rules of a formal language the parser is given. Several of the grammar text files are included in the download so you can test it out for yourself. For more on the topic check out <a href="http://sankuru.biz/en/blog/7-figuring-out-compiler-technology/122-the-need-for-lalr1-packrat-parsers.html">these</a> <a href="http://sankuru.biz/en/blog/7-figuring-out-compiler-technology/123-the-essence-of-map-reduce-programming.html">two</a> posts.
</p>]]></description>
      <pubDate>Tue, 19 Jan 2010 13:03:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Erling Alf Ellingsen's Blog: PHP Must Die]]></title>
      <guid>http://www.phpdeveloper.org/news/13816</guid>
      <link>http://www.phpdeveloper.org/news/13816</link>
      <description><![CDATA[<p>
In a <a href="http://www.steike.com/code/php-must-die/">(slightly inflammatory) post</a> to his blog today <i>Erling Alf Ellingsen</i> shares why he thinks that "PHP must die", mostly due to some of the inconsistencies his has with other languages.
</p>
<p>His examples include:</p>
<ul>
<li>String vs. numeric handling 
<li>That PHP supports octal numbers "by accident"
<li>A lexer bug with hex values
<li>A parser bug involving the ternary operator
</ul>
<p>
<a href="http://www.steike.com/code/php-must-die/#comments">Comments</a> on the post include those supporting the "die" opinion - that PHP just doesn't have it together like other languages - and those taking a bit more balanced approach on PHP's strengths and weaknesses.
</p>]]></description>
      <pubDate>Mon, 11 Jan 2010 13:49:41 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Phil Sturgeon's Blog: Give CodeIgniter's Parser library more kick with Dwoo]]></title>
      <guid>http://www.phpdeveloper.org/news/13581</guid>
      <link>http://www.phpdeveloper.org/news/13581</link>
      <description><![CDATA[<p>
<i>Phil Sturgeon</i> has <a href="http://philsturgeon.co.uk/news/2009/11/Give-CodeIgniters-Parser-library-more-kick-with-Dwoo">a new post</a> to his blog talking about a way to give your CodeIgniter site a bit more "pep" - use <a href="http://philsturgeon.co.uk/code/codeigniter-dwoo">his updated implementation</a> of the Dwoo templating engine.
</p>
<blockquote>
Not wanting to spend too much time re-inventing the wheel I had a look at existing templating engines and decided to use <A href="http://dwoo.org/">Dwoo</a>.  [...] So after a little head-scratching, we now have CodeIgniter-Dwoo. DwooParser? DwooIgniter? Whatever we call it, my new Dwoo implementation for CodeIgniter sits in with "the CodeIgniter way" perfectly and the only code you will need to change within your application is the Parser file and your view files. No changes to your controllers at all!
</blockquote>
<p>
You can download the library from <a href="http://philsturgeon.co.uk/code/codeigniter-dwoo">the code section of his site</a>.
</p>]]></description>
      <pubDate>Tue, 24 Nov 2009 08:39:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPImpact Blog: PHP Simple HTML DOM Parser (jQuery Style)]]></title>
      <guid>http://www.phpdeveloper.org/news/10793</guid>
      <link>http://www.phpdeveloper.org/news/10793</link>
      <description><![CDATA[<p>
On the PHP::Impact blog today <i>Federico</i> <A href="http://phpimpact.wordpress.com/2008/08/07/php-simple-html-dom-parser-jquery-style/">points out</a> a few HTML DOM parsers that work similar to <a href="http://www.jquery.com">jQuery</a>:
</p>
<ul>
<li>the <a href="http://simplehtmldom.sourceforge.net/">Simple HTML DOM Parser</a>
<li><a href="http://framework.zend.com/manual/en/zend.dom.query.html">Zend_Dom_Query</a>
<li><a href="http://code.google.com/p/phpquery/">phpQuery</a>
</ul>
<p>
Check out a <a href="http://www.developertutorials.com/blog/php/easy-screen-scraping-in-php-simple-html-dom-library-simplehtmldom-398/">previous tutorial</a> of his for more information on using DOM parsers to scrape information from remote sites.
</p>]]></description>
      <pubDate>Fri, 08 Aug 2008 12:03:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Skaldrom's Blog: Want to create your own progranning language? Lexer & Parser in PHP!]]></title>
      <guid>http://www.phpdeveloper.org/news/8963</guid>
      <link>http://www.phpdeveloper.org/news/8963</link>
      <description><![CDATA[<i>Skaldrom</i> passed along a <a href="http://blog.oncode.info/2007/10/25/eine-eigene-programmiersprache-erschaffen-lexer-und-parser-in-php/">link to an article</a> he's written up to show how to use one of the more powerful PEAR packages in a simple "Hello World" kind of script - the <a href="http://pear.php.net/package/PHP_LexerGenerator">PHP_LexerGenerator</a> and <a href="http://pear.php.net/package/PHP_ParserGenerator">PHP_ParserGenerator</a> packages.
</p>
<blockquote>
Who doesn't dream about it: Your own programming language, because the syntax and the word are expression! A step continue to go to ascend and from the programming language user to the language creator! This is now possible in PHP, but unfortunately only with minimum documentation.
</blockquote>
<p>
He <a href="http://blog.oncode.info/2007/10/25/eine-eigene-programmiersprache-erschaffen-lexer-und-parser-in-php/">provides an example</a> of the Lexer/Generator in action - handling a simple mathematical operation. The execution code is first with the Lexer definition file and the code for the parser following. Lastly, he has included the code to make things work - passing the test string into his custom Lexer which is passed off to the Parser and a value returned.
</p>]]></description>
      <pubDate>Fri, 02 Nov 2007 11:12:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[David Coallier's Blog: SVN log-per-user parser using SimpleXML]]></title>
      <guid>http://www.phpdeveloper.org/news/7510</guid>
      <link>http://www.phpdeveloper.org/news/7510</link>
      <description><![CDATA[<p>
<i>David Coallier</i> has a <a href="http://blog.agoraproduction.com/index.php?/archives/32-SVN-log-per-user-parser-using-SimpleXML.html">quick hit post</a> today on his blog. In it, he shows how, with a little bit of SimpleXML magic, to parse the log files from your Subversion installation.
</p>
<blockquote>
<p>
Yesterday I was struggling trying to get svn log to display the results for a certain user and this was very annoying.. then I jumped on #svn on freenode, and someone mentionned svn log --xml
</p>
<p>
This apparently made my life much much easier with this simple script I have pulled in a couple minutes.
</p>
</blockquote>
<p>
He <a href="http://blog.agoraproduction.com/index.php?/archives/32-SVN-log-per-user-parser-using-SimpleXML.html">includes</a> <a href="http://dev.agoraproduction.com/svnLogParser.php">the script</a> and a brief set of instructions on how to use it in your installation.
</p>]]></description>
      <pubDate>Tue, 27 Mar 2007 08:33:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[P&agrave;draic Brady's Blog: YAML for the Zend Framework - well, maybe...]]></title>
      <guid>http://www.phpdeveloper.org/news/7494</guid>
      <link>http://www.phpdeveloper.org/news/7494</link>
      <description><![CDATA[<p>
On <i>P&agrave;draic Brady</i>'s blog, he talks about some thought he had on <a href="http://blog.astrumfutura.com/archives/276-YAML-for-the-Zend-Framework-well,-maybe....html">a YAML component for the Zend Framework</a> and some of the feedback he's gotten so far.
</p>
<blockquote>
<p>
Since I'm used to the format from Ruby and Perl and since it's used for a similar purpose in the PHP Symfony framework, I also suggested using YAML configuration files since they are far more readable than XML and remain machine readable. I believe this went over quite well. Later on I realised the Zend Framework has no YAML support, and after some searching noticed the only (apparent) PHP parser was the Spyc library
</p>
<p>
So I fired off a few emails to the fw-general mailing list of the Zend Framework to see if there was any interest. I'd like to thank Matthew and Gavin for their feedback and I've since decided to have a go at implementing a YAML parser in PHP.
</p>
</blockquote>
<p>
He <a href="http://blog.astrumfutura.com/archives/276-YAML-for-the-Zend-Framework-well,-maybe....html">notes</a> that there is already a YAML parser for PHP5 (Syck), but that creating one for the Zend Framework is a different animal. He finishes up the post talking about where to start with the parser, what it is, and the next steps for him in its development.
</p>]]></description>
      <pubDate>Fri, 23 Mar 2007 10:49:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Wez Furlong's Blog: parser and lexer generators for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/6771</guid>
      <link>http://www.phpdeveloper.org/news/6771</link>
      <description><![CDATA[<p>
When finding he was in need of a parser and lexer, <i>Wez Furlong</i> decided to work up one that was PHP-based and a take off of the popular <a href="http://www.hwaci.com/sw/lemon/lemon.html">lemon</a> parser and <a href="http://www.cs.princeton.edu/~appel/modern/java/JLex/">JLex</a> lexer.
</p>
<blockquote>
From time to time, I find that I need to put a parser together. Most of the time I find that I need to do this in C for performance, but other times I just want something convenient, like PHP, and have been out of luck.
</blockquote>
<p>
<a href="http://netevil.org/node.php?nid=941">His result</a> is two new packages - <a href="http://netevil.org/downloads/lemon-php-151.tgz">lemon-php</a> and <a href="http://netevil.org/downloads/JLexPHP-151.tgz">JLexPHP</a> (under a BSDish license) you can download and compile on your own system.
</p>
<p>
Also, if you'll remember a while back, <i>Greg Beaver</i> had wanted something similar (as <a href="http://netevil.org/node.php?nid=941&SC=1#comments">mentioned in the comments</a>) and <a href="http://www.phpdeveloper.org/news/6181">created his own</a> lexer/generator as well.
</p>]]></description>
      <pubDate>Mon, 27 Nov 2006 09:34:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Greg Beaver's Blog: PHP_ParserGenerator and PHP_LexerGenerator]]></title>
      <guid>http://www.phpdeveloper.org/news/5678</guid>
      <link>http://www.phpdeveloper.org/news/5678</link>
      <description><![CDATA[<p>
<i>Greg Beaver</i> has blogged today with <a href="http://greg.chiaraquartet.net/archives/138-PHP_ParserGenerator-and-PHP_LexerGenerator.html">more about</a> the port he's been wokring on of the Lemon parser generator to PHP5, this time discussion the creation of two packages - PHP_ParserGenerator and PHP_LexerGenerator.
</p>
<blockquote>
<p>
Last week, I blogged about completing a port of the Lemon parser generator to PHP 5, which I thought was pretty cool. However, in an email, Alex Merz pointed out that without a lexer generator to accompany lemon, it's pretty difficult to write a decent parser.
</p>
<p>
After Alex's email, I started thinking about what it would take to write a lexer generator. Basically, a lexer generator requires parsing and compiling regular expressions, then scanning the source one character at a time to find matches. So, it occurred to me that perhaps simply combining regular expressions with sub-patterns could accomplish this task quite easily.
</p>
</blockquote>
<p>
He <a href="http://greg.chiaraquartet.net/archives/138-PHP_ParserGenerator-and-PHP_LexerGenerator.html">goes on</a> to explain this process, showing how a simple regular expresion call (and a look at its return arguments) could create a simple, easy solution. Since the <a href="http://re2c.org">re2c</a> format is still unsupported in PHP (without a goto to go to), he opts to stick with the regular expressions and creates a "lex2php" format instead.
</p>
<p>
He's packaged up both halves of <a href="http://greg.chiaraquartet.net/archives/138-PHP_ParserGenerator-and-PHP_LexerGenerator.html">this setup</a> and has already posted proposals for them to the PEAR site:
<ul>
<li><a href="http://pear.php.net/pepr/pepr-proposal-show.php?id=415">PHP_LexerGenerator</a>
<li><a href="http://pear.php.net/pepr/pepr-proposal-show.php?id=416">PHP_ParserGenerator</a>
</ul>
</p>]]></description>
      <pubDate>Sun, 25 Jun 2006 17:00:41 -0500</pubDate>
    </item>
  </channel>
</rss>

