Very interesting article. I recently wrote RubyKif, a class that parses and emits the PowerLoom variant of KIF (Lisp-style predicate calculus).
I used Treetop, so I'll be interested to compare the size and complexity of my solution to yours. I also map tokens to symbols, though I translate numbers and strings across. FWIW, I also translate comments to symbols.
Although this is a simple and robust mapping, turning a KIF operator such as :<<=>> into the Ruby symbol :':<<=>>' does nothing to improve its readability (:-).http://cfcl.com/twiki/bin/view/Projects/Arti/Patterns/RubyKif_H2
I've been wondering about stealing something else, BTW. The jQuery library has some really powerful mechanisms for dealing with DOM trees. Shouldn't Ruby be able to use the same mechanisms on random lists of lists?