This project connect: ruby lexer (rlex) that was written by:
http://raa.ruby-lang.org/project/ruby-lex/and ruby parser (rbison) that was written by:
http://src.gnu-darwin.org/ports/devel/ruby-rbison/
This two projects use flex and bison from c\c++ to generate c\c++ code.
And from that moment you can use wellknown lexer\parser languages.
Not so simple template to programming, but simple to understanding inside. Use lex & bison in your ruby projects to parse input, or to create different compilers.
Contain flex and bison (win32 binaries) that you can use.
Easy to use, and work!