Treetop is a Ruby-based DSL for text parsing and interpretation. It facilitates an extension of the object-oriented paradigm called syntax-oriented programming. There's a readme that will get you going and some examples. WWW: https://github.com/cjheath/treetop