 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Sherif Ramadan: How to Write an Operator Precedence Parser in PHP
by Chris Cornutt January 21, 2013 @ 11:21:22
Sherif Ramadan has a post looking at creating a better operator precedence parser in PHP. His example is a fully PHP implementation that takes equation strings and evaluates them to create the result.
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.
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.
voice your opinion now!
operator precedence parser string token shuntingyard algorithm
Joshua Thijssen's Blog: Using vagrant and puppet to setup your symfony2 environment
by Chris Cornutt June 29, 2012 @ 11:04:41
In his most recent post Joshua Theijssen shows you how to set up a complete Symfony2 environment, automated with the help of Puppet and Vagrant.
Together with other tools, setting up a complete development environment with just a single command is not only reality, but it's becoming for a lot of developers a daily practice. But even for open source projects like joind.in and protalk.me are seeing the benefits of having "development environment on the fly". New contributors don't have to spend a lot of time setting up their environment, but it's automatically generated: the code setup, the database server together with a filled set of data, any additional components like varnish, memcache, reddis etc. This blog post gives an overview on how to setup a symfony2 project with the help of vagrant and puppet.
He provides you with some examples in the form of a Vagrantfile that sets up a 64 bit CentOS instance and configures the server with a few settings and points it to a Puppet configuration. He includes a basic set of Puppet configuration examples and shows how to use it to install various packages, set up MySQL, load phpMyAdmin, configure PHP and, finally, bootstrap the Symfony2 by seeding a Doctrine schema.
voice your opinion now!
vagrant puppet tutorial configure setup symfony2 vagrantfile pp
Erling Alf Ellingsen's Blog: PHP Must Die
by Chris Cornutt January 11, 2010 @ 13:49:41
In a (slightly inflammatory) post to his blog today Erling Alf Ellingsen shares why he thinks that "PHP must die", mostly due to some of the inconsistencies his has with other languages.
His examples include:
- String vs. numeric handling
- That PHP supports octal numbers "by accident"
- A lexer bug with hex values
- A parser bug involving the ternary operator
Comments 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.
voice your opinion now!
opinion lexer parser octal ternary
|
Community Events
Don't see your event here? Let us know!
|