Post by Peter Cooper on December 15th, 2006
Dhaka - Ruby generator for tokenizers, parsers, and evaluators of context-free grammars

- Treetop - Powerful But Easy Ruby Parser Library
- Recursive Descent Parser for Ruby
- Parsing XML with REXML using Expat


Dhaka is a set of tools written in Ruby by Mushfeq Khan that can generate tokenizers, parsers, and evaluators of context-free grammars (my own shabby contribution in this field was posted to RubyInside recently!). Dhaka's ultimate goal is to make a pure Ruby, flexible parser generator. From the official site:
Dhaka provides DSLs specialized for specifying grammars, tokenizers and evaluation rules. It can take a grammar and generate a finite-state automaton for parsing it. The generated parser can then be 'compiled' to ruby source-code so that it need not be generated again. Dhaka also supports exporting generated parsers to the GraphViz dot format for visualizing states and actions.
A couple of interesting examples of how Dhaka can be used to give simple solutions to Ruby Quiz problems are also given.

Click here to add on del.icio.us








