Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Dhaka – Ruby generator for tokenizers, parsers, and evaluators of context-free grammars

By Peter Cooper / December 15, 2006

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.

Other Posts to Enjoy

Twitter Mentions