Parslet 1.1 - a PEG parser library

parslet is a Parsing Expression Grammar based[1] parser generator
library. Uff. Now that is out of our system, here goes what it really
does: It makes writing parsers pleasant for the rest of us. No code
generation, clear access to data, unit testable.

Installation:

gem install parslet

Changes:

  • For deep grammars, this release is several orders of magnitude
    faster. Really! Benchmark at [2].
  • Export to citrus and treetop dialects.
  • You can apply visitors to the grammar now.
  • Bug fixes and code cleanup.

Synopsis:

require ‘parslet’
class Mini < Parslet::Parser
rule(:integer) { match(‘[0-9]’).repeat(1) }
root(:integer)
end

Mini.new.parse(“132432”) # => 132432

Please, ladies and gents, amuse yourselves!

[1] Parsing expression grammar - Wikipedia
[2] press play on tape – Parslet and its friends

On Feb 2, 2011, at 00:25 , Kaspar S. wrote:

  • For deep grammars, this release is several orders of magnitude
    faster. Really! Benchmark at [2].

That’s really awesome work!