[ANN] Grammar 0.8

E

Eric Mahurin

[Note: parts of this message were removed to make it a legal post.]

Since I was giving a presentation about Grammar at the Lonestar Ruby
Conference (which ended today), I thought it was about time to release
another version of Grammar. I posted it yesterday here:

http://rubyforge.org/projects/grammar/

and the presentation is here (before a few modifications):

http://grammar.rubyforge.org/0.8/grammar_lonestar2008.swf

Here are some release notes:

* second complete rewrite since Grammar 0.5
* BNF-like grammar written directly in Ruby
* LL(1) parser
* separation of Grammar and parser generator ("engine")
* engines could generate a parser in a particular target language or do
something else with the Grammar tree
* current engines: Ruby (generate stand-alone very flat Ruby parser), Ruby0
(directly parse while traversing Grammar), Ruby2CExt (Ruby + convert to C
using ruby2cext)
* lexer and parser grammars are specified in exactly the same way - one
parses characters and the other tokens
* can write a lexer-free parser
* may define tokens however is appropriate
* methods for a lexer (or just token) Grammar to a parser Grammar -
including multi-threading
* arbitrary lookahead can be achieved with the backtrack method
* tail-call optimization of recursion (right recursion)
* directly handles left recursion (historically only doable with (LA)LR
parsers only).
* very very fast - on par with the best hand crafted/tuned recursive descent
LL(1) or Regexp (LL(*)) parsers. 100X faster than many other parser
generators. And that is before Ruby2CExt.

Comments and feedback are quite welcome.

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top