Nathan Sobo: Treetop: Bringing the Elegance of Ruby to Syntactic Analysis

Posted by Kevin Fri, 02 Nov 2007 20:23:00 GMT

These slight technical difficulties. Handled fairly elegantly. Hot guy.

I was surpised with how many of you said you had written a parser when Jim Weirich asked the question this morning, since I would have expected very few folks to have written parsers with classic context-free generated grammars. And then again, I was surpised with how few of you said you had written a parser when Jim Weirich asked the question this morning, since I know that lots of folks have written parsers – at least parsers like regular expressions to parse strings.

Parsing Expression Grammars are mad hot since they can do recursion – and Treetop is a Parsing Expression Grammar.

Arbitrary ruby is not allowed inside of a treetop grammar as at yet – maybe in the future.

And…this live coding followed. Good times parsing a mathematical expression and testing the various pieces.

One of the cool things about Treetop is that it does not “lex”, unlike many other parsers. There are cool posibilities with sharing well-constructed grammars and reusing grammars inside of other grammars to construct more complex grammars. Neat. Really enjoyable presentation.

Posted in  | no comments | 3 trackbacks

Comments

Trackbacks

Use the following link to trackback from your own site:
http://notkeepingitreal.com/articles/trackback/1856

  1. From cheats for solver
    One Taney County escapee found,
    One of two inmates that escaped from the Taney County Jail Monday night was found this morning in a wooded
  2. From High quality pemancar fm stereo
    CARSTAR, PIC win in Babe
    Four games. Four winners. That pretty much sized up Babe Ruth 10-and-under and 12-and-under softball last night at Rolling Hills
  3. From wwwbustyadventurescom
    It's not in the script
    It's not in the scriptSauk Valley Newspapers, IL -Jul 1, 2007Over the years, there are been numerous proposals to put wrestling under

Comments are disabled