<?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>Fri, 24 May 2013 18:29:18 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Sherif Ramadan: How to Write an Operator Precedence Parser in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19068</guid>
      <link>http://www.phpdeveloper.org/news/19068</link>
      <description><![CDATA[<p>
<i>Sherif Ramadan</i> has a post looking at <a href="https://sheriframadan.com/2013/01/how-to-write-an-operator-precedence-parser-in-php/">creating a better operator precedence parser</a> in PHP. <a href="https://github.com/srgoogleguy/Mphp/">His example</a> is a fully PHP implementation that takes equation strings and evaluates them to create the result.
</p>
<blockquote>
Operator precedence parsers are very simple on the surface. So don't feel in the least bit intimidated, because by the time you've read through this I hope to have you walk away with a solid foundation on how to write your very own operator precedence parser. The goal is to understand how to solve the problem of operator precedence parsing, and not necessarily to write your own parser. Learning how the problem can be solved is the most important thing to take away from this article.
</blockquote>
<p>
He starts with an introduction to the concepts behind "operator precedence" including processing order and grouping. He also mentions infix and postfix (RPN) notations for handling different formats of equations. He used the "Shunting-yard Algorithm" and how it relates to handling the different parts of the equation, one at a time, in the correct order. He rest of the post is dedicated to the details of the execution in the tool, including code examples and the tokenization of the strings passed into it.
</p>]]></description>
      <pubDate>Mon, 21 Jan 2013 11:21:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ibuildings Blog: DPCRadio: Let's Build a Parser]]></title>
      <guid>http://www.phpdeveloper.org/news/18652</guid>
      <link>http://www.phpdeveloper.org/news/18652</link>
      <description><![CDATA[<p>
On the Ibuildings blog today they've released the latest episode of their DPC Radio podcast series as recorded at this year's <a href="http://phpconference.nl">Dutch PHP Conference</a> (2012). In <a href="http://blog.ibuildings.com/2012/10/23/dpcradio-lets-build-a-parser/">this new episode</a>, they share <i>Boy Baukema</i>'s session "Let's Build a Parser".
</p>
<blockquote>
During this talk an introduction will be given to parsing. Terms like 'formal grammar', 'lexing / scanning', 'LL / LALR / PEG' will be explained and put into context. We will look at a recursive descent parsing as a practical way to parse languages. Finally the audience will be left with ways to get started with parsing structured text into memory.
</blockquote>
<p>
You can listen to this latest episode either through <a href="http://blog.ibuildings.com/2012/10/23/dpcradio-lets-build-a-parser/">the in-page player</a> or by <a href="http://dpcradio.s3.amazonaws.com/2012_002.mp3">downloading the mp3</a>. You can also see the slides from the presentation <a href="http://www.slideshare.net/relaxnow/lets-build-a-parser">on Slideshare</a>.
</p>]]></description>
      <pubDate>Wed, 24 Oct 2012 10:19:18 -0500</pubDate>
    </item>
    <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>
  </channel>
</rss>
