Refactored the Parse Engine
November 01, 2005, at 12:28 AM
I've been dusting off the GLR parser again (described here). I decided it had gotten too obfuscated to maintain properly, but I didn't want to rewrite the code from scratch...
So I took to heart Joel Spolsky's old advice about refactoring versus reimplementing. And guess what? It worked. I fixed the bugs that had stumped me and I think I have a grasp of what to do about the efficiency issues. I've also been working on making the code nicer so that it can be embedded in other projects easily.
And then, of course, real life came along and forced me to put it down for a couple weeks. Oh well. The door is open to more progress now.
It's been forever since I posted. So, in keeping with Jakob Nielsen's list of blog-design mistakes, I'm going to start posting on a regular basis, every other week. I also migrated from Bosxom to Movable Type. The big benefit is that comments now work; also, it no longer looks hideous.
Comments
The code! The code! :)
I'm about to rewrite a parser of mine, and an alternative to CL-Yacc would be nice!
Posted by: Rich | November 5, 2005 12:27 PM
Well, it's a lot less embarassing to read than it was before, but the efficiency problem would still keep you from using it... It conses too much. If you're offering to help, on the other hand.... Grin.
Posted by: Dan Knapp | November 5, 2005 03:30 PM
Hi,
What is the current status of your parser?
Posted by: Peter Mechlenborg | October 27, 2006 10:34 AM
I too would be greatly interested in the code. I can't imagine parsing RFC 2822 with traditional parsers—the grammar is (at least internally) ambiguous, and it seems really hard to lexically analyze messages.
With no background in parsing at all, except for a writing a trivial backtracking recursive-descent PG in CL, I was about to take on writing an implementation of a SGLR PG. So, it would obviously help me if you shared the code. =) I'd really rather not write something like this. Parsing isn't my passion. (RFC 2822 isn't either; these are all tangents for a different application goal.) Again, emphasizing that I'm not a parsing geek, I'd certainly be willing to try helping with the code wherever I can, as I run into problems. Also consider that my feedback as a user of the code could be valuable.
Thanks,
Posted by: J.P. Larocque | February 18, 2007 09:17 PM