What Marpa Does
What Marpa isMarpa is a new parsing algorithm with a decades-long heritage. Its lineage starts with the algorithm invented by Jay Earley. Marpa is the first algorithm to combine the improvements to Earley's algorithm made by Joop Leo with those discovered by John Aycock and R. Nigel Horspool. Marpa's "situational awareness", and Ruby Slippers parsing, are a new feature.
Posts about MarpaI blog about Marpa on my Ocean of Awareness blog. Here are the more important posts:
The Bovicide SeriesYacc and its derivatives are considered the standard in parser generators. Yacc is part of a great series of traditions it was my privilege to watch being formed, and I have the greatest respect for its inventors. But to my mind yacc is one tradition more honored in the breach than in the observance. In this series I describe what will be required for a parsing algorithm to displace yacc's LALR, and why I think the Marpa algorithm has what it takes and more. The first three requirements are described in my first post, Killing Yacc: 1, 2 & 3:
Error reporting has long been overlooked, and it is something at which yacc was astonishingly bad. I looked at the issue of development-time error reporting in Why the Bovicidal Rage?:
And in Bovicide 5: Parse-time Error Reporting, I looked at the other half of error reporting.
Both hand-written recursive descent and Marpa meet, to various degrees, all five of the previous requirements. The last requirement, stated in Bovicide 6: The Final Requirement, was the tie-breaker. Hand-written recursive descent has many strengths, but it will never be available as a library.
The "Perl and parsing" seriesMy "Perl and parsing" series used Perl to illustrate parsing theory and parsing theory to investigate Perl. I am not one of those who believes that mathematics takes place in vacuum -- it follows trends and even what are more accurately called fashions. Therefore this series has a lot of discussion of how current parsing theory came to be.
ExamplesHere are some simple & elegant examples of Marpa parsers that others have done:
TheoryFor those interested in the mathematics behind Marpa, there's a paper with pseudocode, and proofs of correctness and of my complexity claims. | LinksDistributions: Blog: Mailing List (quite active): Repository of stable code:
|