It Seemed Like a Good Idea at the Time Coding, Mostly

9Nov/081

It's Alive!

Wow.  From idle complaints to a working implementation in 12 days.  And most of those days I did exactly no work on this project either.  I'm surprised.

Long story short, it turns out it's actually not that hard to write a parser, and a lexer is even easier to do if you just use a preexisting regular expression library.

So now I can officially announce the existence of the Helicon Parser Toolkit.  It's small, it works for my purposes, and it isn't Lex/Yacc.  I don't know what the official classification of the parser is, I just did whatever seemed like a good idea at the time.  It has no lookahead currently, but since I just wanted to parse Scheme, that's fine by me.

The lexer and parser together weigh in at 438 lines of code (not including the two header files), and all of it except for about five functions is just bookkeeping.

The lexer uses PCRE for its regular expression matching, and the parser is entirely coded by hand.

As far as Valgrind can tell me, there are no memory leaks other that what GNU Readline brings to the table (maybe this is my fault and I'm using it wrong.  Will check later.)

It seems to work so far.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Tagged as: , , Leave a comment
Comments (1) Trackbacks (0)
  1. Wow, I really do think that’s pretty fantastic. You’re doing some amazing things, keep on posting. Now I’m off to go do some programming of my own (or, pretend that I’m programming but actually open up a new tab and watch something on Netflix…).


Leave a comment


No trackbacks yet.